Beginnings of the section 5 implementation (heap)