Erlang Programming codes