changed PriorityQueue to TreeSet

PriorityQueue does not actually iterate properly