added toc and improved pagination