Updated code to generate html data