new code for the simulator
new