state machines (wip)