heapsort worked