Updated MemoryManager class