Minor mod in the collision detection algorithm