separated js, added localstorage functionality for display and title