add line segment collision detection