state machine MK II