Initial working version with localStorage