Create state_machine.cpp