updated javascript and index.html