Implemented priority queue