Cleaned up a bit automata