Pretend you're the computer. Trace through the execution line by line.
Try posting what you think is happening; it should be an ordered list of steps from where you start executing until the end. Post the *exact* code that you believe is being executed by the steps you list. When you run the program, see if the code you believe is being executed is actually executed. If there's a discrepancy between what is happening and you *think* should be happening, try to figure out why.
Remember: we don't have your computer in front of us. It's difficult to figure out what *is* happening vs. what *should* be happening and compare both to your expectations. If you have to, post the entire code again, and maybe somebody will copy it in to their
IDE and see if we can point you in the right direction.