Please edit your post and wrap your code with


<YOUR CODE HERE>

to get highlighting and preserve formatting.

Be sure the code has proper formatting with indentations showing logic nesting...