implemented HeapPriorityQueue