Improved xor mask