heap sort, neds cleanup