Renamed value to distance in all places