Documentation for the state machine