arranging heaps