line segment problem