added array xor function