Added function for scaling.