Recoded scaling function.  Corrected clamp limits.