Your code would be a lot easier to read/review if you followed standard formatting conventions. Sorry to sound anal, but there are some formatting oddities that make the code really annoying to read. Some of these things are also extremely nonstandard such that it would be good to correct before bad habits form.

* **Always** put closing braces on a separate line. The space savings isn't worth the cost in readability and chance for future errors.
* Always put space after a comment, even if it's a single line comment. This makes comments much easier to read.
* Put space before opening braces.
* Don't mix tabs and spaces.