implemented proper scaling.