long lat distance function + random array function