mixed up ternary, stupid me...