extracting blocks from text