ACK!

I forgot to mention - with the code the way you had it, when it "froze" (entered an endless loop), you could stop it by pressing CTRL + Pause.