Addressing review feedback. Add checkHeap()