Update memory.cpp