Added priority queue functionality to util file.