move scaleMethod.m to lib