Updated the priority queue based on the freq in the Node