maximizing XOR problem