Ah, I got it. I was missing the wait(1); after the inkey_active=0; line. Makes a world of difference. It works now!

Thanks guys!