some updates to how state machines work