added unigram model to speed up recursion