fixing heapsort