Heap Sort with a list