added friend & mem_alloc files
modified friend code