Cleaned up some Automaton Code