seems to work on basic automaton
example automaton