reorganized code and html.