fixed heapsort