heap sort correction