https://sheremetov.com/programming/erlang-exercises-2/