add more automata code