Integrated JS with Shawn's front-end, and polished the error messages