Added custom contour function.