state machine tool