edited heapSort