removed if and elseif and added switch case