Started setting up state machine