generating toc in process function.