erlang exercise