Update index.html

reformatting and commenting javascript to understand it better