Changed optimization to rescale2().