converting heaps