small changes plus the state machine diagrams