Refactored If's

Modified certain IFs for case matching