First implementation, XOR