update made small changes to file saving