Updated distance variable functionality