changed into ternary