renamed home.js to frontend.js and refactored frontend.js