Added a scale function