refacoring function test_rescaling()