copyMemory added