Modify the code of scaling