first step on the way to implementing polylines with to_polygon functionality