Fixed the NUM_LETTER_GROUPS to use dictionary size