Contour class refactored
Merge branch 'contour_fix'