Updating PQ with flags