Added documentation for StateMachine