Heapsort updated