added tons of code for generating HTML.