genericised the PriorityQueue heap datatype