added generate_html method