added the save and load file functions