Hopefully builds functionality for sortHeap