Working on priority queue