reedited code for js and html.