you don't need $xor() there, xor-ing with 0 doesn't change a number :P