calculating distance to locaitons