Added state machines