added comparator functionality to PriorityQueue