scale function added