more state machine hacks