improve LineSegment