Update state_machine.c