automaton running and responding to events