Removed one useless variable
Added use of local storage