Changed the simulator code to do large chains at once