Automata seems correct