Added comments to the collision detection