modified priority queue to node structure