Added max word length calculation.