word discovering function