Heap working
Heap refactoring
wip