only need heapsort