add memory functions