added required functionality to index.html