generate a working toc