First Erlang homework