fix parity functions