Added the fix for the sorting of the atoms when colliding.