added inplace XOR