Added autosaving feature
Added tests