added constructor to StateMachine