Cleaned up the if statements in main.js
Merge pull request #2 from Tohie/master

If Statements