Created functions for converting lines to contour and tested