Updates to functions to include save_corpus function.