Changed algorithm for finding paragraphs