Added local storage and a few corrections