uncommented code for text extraction and subjects