fixed logic bug in simulator.py::79