Implementing Xor operation