added scale function