logic with number_of_words up to 6