updated javascript with mileage calculations