Update StateMachine.py