Hi, Not looked at the code in detail yet. Probably not a big deal but a small simple win is to move Math.PI/180 into a variable and do the calculation once rather than calculating 4 x times around the loop.
> > lon1 = > tempArray[i].longitude*Math.PI/180; > > lon2 = > tempArray[j].longitude*Math.PI/180; > > lat1 = > tempArray[i].latitude*Math.PI/180; > > lat2 = > tempArray[j].latitude*Math.PI/180; Thanks, Justin