documentation of state machine added