stuff for the xor metric