Started to modify simulator.cpp