Upadated to have if, elseif, and else clauses