picture of state machine