fix and test rescale