Added functions to index.html