finished handle_PQ with optimization