Localstorage implementation
Improved localStorage and restoring