complete with small bug in downHeap