adding files from learn you some erlang chapter 15 (state machines)