     ///Returns the absolute value of the smallest angle difference between two directions and an indication of the direction of change
     /// This is useful in determining both the magnitude and direction of the change of heading.
     func headingChangeTo(other:CLLocationDirection) -> (magnitude:CLLocationDirection, motion:CLLocationDirectionMotion) {
-        guard self.isValid() && other.isValid() else {
+        guard self.isValidDirection() && other.isValidDirection() else {
             return (kCLLocationDirectionInvalid, .clockwise)
         }
 

        }

        return (angle, motion)

    }
}

extension MKRouteStep {
    var distanceMiles:Double {
        return metersToMiles(distance)
    }
}

extension MKRoute {
    var distanceMiles:Double {
        return metersToMiles(distance)
    }


    func boundingRadius() -> CLLocationDistance {
        let (northWest, southEast) = boundingCoordinates()

        guard let northWestLocation:CLLocation = CLLocation(location: northWest),
              let southEastLocation:CLLocation = CLLocation(location: southEast) else {
            return CLLocationDistance.NaN
        }

        let circumference:CLLocationDistance = northWestLocation.distanceFromLocation(southEastLocation)
        return circumference/2.0
    }
}

