Erlang practice code from my study of Learn You Some Erlang