Added scale function for centering and/or scaling