wrote code to generate index of the responses (index.txt)