Good question! As far as I can tell, your code is right. I tried it myself and it worked correctly. What does it print as the value of these variables when INPUT fails? If it's a 0, it may be incorrectly detecting that you've pressed enter on your keyboard or the A button.