xi brian,
Please use
Code tags when you are entering codes in you post, so that it will be helpful to people who want to review your code and offer some help to you. I am trying to answer your post but it is difficult to read your code. so please use code tags.
And not working will not get you any help here. Please
tell us the details. Tell us what exception you get, so that we could provide solutions to you.