fixed word searching algorithm