add file code to store all the functions used in state_machine.py