A Deterministic Finite Automaton in C#