Moved save-history to a fuction w/ optional file argument