Simulation finished, data recording function added, still a bug somewhere in data recording!