Added auto-saving to localStorage