fix avg distance