Good stuff... now all you've got to learn is how to indent your code properly and toss in a few comments...

Think of it this way... You're working on a relatively complex project... you write it like you did above... if you come back to it in 5 years are you still going to be able to follow it?

You should cultivate Good habits early... rather than fixing things up after the bad ones, later.