Please do not start a new thread when you have questions related to something you have already posted. It will help others be able to join in if you just reply to the old thread. It also helps maintain continuity for those of us that are trying to help you.
With that said, it will help a lot if you tell us what it DOES print out. You should also describe how this differs from what you expect. If you can provide this information, I will be glad to help you from there.
If you look below the Add Reply button there are other buttons that you can use. One is the CODE button which will create CODE tags that you should put your code withing so that it keeps its format/indentation, which makes it a little easier for us to read.