First three challenges in Erlang