Redefine the function that can calculate the scale factor