STOPPED PARTICLES FROM HAVING EXPLODING ACCELERATIONS. Also put the simulation in a function for modularity