max PQ size and add function