The other issue is a bit more complex. Basically: B==#RIGHT is true when Right is the *only* button being pressed. B AND #RIGHT is true when Right is pressed, regardless of other buttons. It's hard to explain without getting into binary, but basically each button is a bit. AND matches the bits on one side with the bits on the other side, and creates a number with only the bits set on both.