scale function tested