Basic heapsort