Updated automata.py to reflect the instructions