added localStorage save, restore, and destroy