understanding heaps