added XOR as a testing function