made the c state machine more modular- easier to add more state machines