add memory.cpp, memory.h file. makefile modified