finishing DFA simulator