Changed StateMachine update to accept a current state
Changed StateMachine.update to accept currentState