Turned if's to switch