haversine function for distance, fix order in return data