There has got to be a better way to select contour lines

Check out the divide and conquer method for locating these errors.