Working version of all codes including text mining.