Text this: New Algorithm of Joining a Set of Segments into a Simple Polygon