heapsort fix