Working StateMachine