replaceListValue :: [Point] -> Point -> Int -> [Point]
replaceListValue (x:dstContours) end_pt wpos
        | wpos == 0 = end_pt : dstContours
        | otherwise = x : replaceListValue dstContours end_pt (wpos - 1)
replaceListValue :: [Point] -> Point -> Int -> [Point]
replaceListValue (x:dstContours) end_pt wpos
        | wpos == 0 = end_pt : dstContours
        | otherwise = x : replaceListValue dstContours end_pt (wpos - 1)
replaceListValue (x:dstContours) end_pt wpos
        | wpos == 0 = end_pt : dstContours
        | otherwise = x : replaceListValue dstContours end_pt (wpos - 1)