Move countWordsRegion somewhere better