Added min/max counting to XOR.