Made XOR into a function