     public func lineDistance (points: [[CLLocationDegrees]]) -> CLLocationDistance {
         var total = 0.0
         
-        for i in 0 ..< points.count - 1 {
+        for i in 0.stride(to: points.count - 1, by: 1)  {
             total += self.distance(points[i], b: points[i + 1])
         }
         return total

        var sum = 0.0
        var slice:[[CLLocationDegrees]] = []
        
        for i in 0 ..< line.count - 1 {
            let p0 = line[i]
            let p1 = line[i + 1]
            let d = self.distance(p0, b: p1)

        var minT = 0.0
        var minI = 0
        
        for i in 0.stride(to: line.count - 1, by: 1) {
            var t = 0.0
            var x = line[i][0]
            var y = line[i][1]
