added to get_mem_layout function