introduced scaling code