Some Erlang code I wrote for learning the language