Switched if/elseif/else to switch statement