1. Learn to indent your code better. Frankly, this is a mess, and if it were any larger it would be completely unreadable. A consistent indent makes reading code, preventing bugs and finding bugs...