finishes deterministic finite automaton