first working state machines