Corrected the calculation of the collision