Added a fixed size priority queue for better speed.