Adding a PQ extraction function.