working out the HTML structure