oh yes, finally working version of automaton with completed logic; all tests pass