continued work on heap, refactoring stuff...