A simple example finite state machine for an exercise given to me