optimized scaling equation
cleaned up the whitespace