Add function write_to() and read_from() to save and retrive data