Shifting correction

The source of the problem was the 'ratio' (I forgot to calculate its square root).
I also changed the 'realSpeed' variable to 'shifting'.