recreate switch with if-elseif statements