heap sort is now working