finished contour detection