Fleshed out PQ implementation