change xor to sum