connecting contour endpoints