pedigree: added DISTANCE loop variable