maxheap work