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