updated mem_free, test
erge