added all of the code used to run the simulator