start of heap implementation