almost done frontend.js