tested for XOR