Completed rebuildDictionaryForDecompression function