add memory method