better checking of word lengths