Update simulator.cpp