Solution for challenge 10, easy, in erlang