code change implemented to calculate distance from variable - still may need to configure calculated from variable