Have you stepped through this with a debugger or at least added some print statements to figure out what's going on? Your next step is to figure out where this stops working. Can you get the input...