Solution for xor