Fixed #14 again

-previous version was using Random class which is not thread-safe
-fixed a small bug in Simulation.java