Distance function.
Added get location function.