debugged Haversine