Bugs in rotation: left and right swapped, fixed modulus of negative number