fixed scaling to adapt max and min for current timestep
fixed scaling to adapt max and min for current timestep