fixed bug in haversine formula