Cleaning up comments and removing useless code
Replacing a large number of if statements with one line