removed js from index file and moved it to frontend.js
shifted frontend code form index.html to this new file