updated to support haversine