implemented scaling