Trying to improve the collision calculation.