added more comments and removed unused code in index.html