XOR function for assignment 2