Added mod instead of nasty reinit in XOR.