fixed it so that the simulation stops /before/ simulationEnd is reached, not afterwards