refactored "memfree" to "free", "memalloc" to "malloc"