made numofwords classifier more compact