implement MOR and MXOR operations