not working for 3 input XOR