Decoupled contour plotting from algorithm