added xor function for great justice