removed debug; distance is only calculated if location is given