Add code for priority queue