heapsort with bug. unstable