state machines ftw