Programming Erlang example code