calculation of distances and percentage population