exercises from http://www.erlang.org/course/exercises.html