"I'm sorry you feel that my question was inappropriate."
What precisely is your question? A long time ago Ovid wrote this reply: Clean your room. If you take the time to make your question easy to read, then others will give the time to help you find the solution.
For starters, please consider formatting your code with Perl Tidy as your indention is extremely inconsistent and makes your code extremely hard to read.