Playing with state machines