heap sort fix