fixed rescale.m