added scaling calculation to variable