Changing ugly if statements

to ugly switch statements