building iteration over inner dictionary for letter frequencies