adding save_to_memory method (beginnings)