More state machine work