fixed contours code