Update simulator.java

Fixed a small bug