continued work on state machine