Added merging line segments