fix

average distance bug fixed