Further refinement of distance calculation to match ED's.