Added multi-dimension scale function