Contour generation working