updated check_contour script