Please edit the code and format it properly. Logically nested statements(within {}s) should be indented.
Too many statements in the posted code incorrectly start in the first column.