finished the localstorage implementation