         
         if (dist <= 0) { return line[0] }
         
-        for i in 0 ..< line.count - 1 {
+        for i in 0.stride(to: line.count - 1, by: 1) {
             let p0 = line[i]
             let p1 = line[i + 1]
             let d = self.distance(p0, b: p1)

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

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