made main.c, error cases for mem_init