modify heap sort