fix html formatting and add toc