Added state machine diagram.