added save file function that confirms with the user when saving to a preexisting file