Added average distance calc
Added average distance calc