added code to generate html from data