Small fix to the DistanceFrom function

it works now