part of heapqueue