fix the PCH algorithm