renamed q to pq