added ugly xor' to meet the fold requirement