Changed the chain of if statements to else-if
Merge pull request #911 from Beakerboy/patch-3

Changed the chain of if statements to else-if