fixed text analysis script