DFA now working