fix parity bitwise operation implementation