state machine documentation