segfault fixed, but xor fails semantically