merged with Johannes Rescaling branch, but used slighly different
rescaling method