programming erlang code