Building DFA