fixed ternary stuff