Fix a couple of bugs. Make the simulation run 100x and halt if