AntMemory function