function distanceFrom added