Cleaning up heap.h
Cleaning up heap usage
Fixing big bug that made the heap wrong after variable replacment
Better code layout