ternary and case