added code for toc generation on text and section level