Update index.html

cleaning up the logic a bit.