restructured localstorage, added mark and sweep