Started implementing mem_alloc