Added mem.h & mem.cpp