Update index.html

Add more flexible implementation