autosave mostly working, needs clean up.