adding a working autosave function

i might change the text input to a dropdown