line 321 changed xSpeed to zSpeed 

inside the if condition