heap sort text formatting