added print functionality and nvm_heap_init