Update simulate.cpp