Replace contour module by simple function