Fixed calculation of avg angular distance