Handle AND, BOR, XOR