Changed scale function.