basic deterministic finite automata