calculating distance for selected addresses