Scaling - initial draft 

Marek please review the code
Don't use parentheses around the condition of an `if`.