priority queue working