rescale function

Rescale values to new range