Example code from Introducing Erlang