implemented get_mem_layout function, added basic test to main.c