moved javascript in index.html to external file