learning some erlang code