refactored Heap