fixing haversine the empire strikes back