added comparator for minPQ. seems to be working.