ternary explanation