Added the simulator code