get rid the xor the function