HeapSort modified