map reduce version of simulation