working on priority queue