Priorityq

Dense code blocks like these can benefit from comments.  Not only for my sake, and the sake of others like me who are reading your code, but for your own sake, down the line, when you try to come back and read your own code.