state machine.