Now that looks like very nice and beautiful code. You may not know this, but very few newbies who come here can write as readable as you just did.
Well done.
Now, if you could just apply that to the rest of your code, you will have already mastered one of the fundamental principles of being a programmer - to write readable code.