switched if/elseif to switch