implement and test distance calculation using haversine formula.