I am about 100% sure you have all seen one of these before, they are so common, but I just wanted to share this because it took me a long time to figure it all out. Also, the bit at the beginning is completely pointless, it's just there.
It's pretty good, but I would like to say that you could tidy up the code a little. It's mainly where you print the blank spaces. I think you want a waiting system, so I'll see if I can 'fix' this for you.