Implemented max priority queue.