added set_memory_data() function