Use the haversine formula to get a more accurateresult. Added max_distance to filter in KM.