added local variables; using iteration in haversine function; sourcing correct file name