Deleting contour algoritm is improved.