Almost fixes the heap adding and sorting functions