reorganized js and html file