Example code from the book _Erlang Programming_