Tidied up init_heap()