Exercises from Programming Erlang book