xor problem with math trick