changed input to state machine