implement memory protocol