If the algorithm finds a unique character not yet found in the dictionary, then a new dictionary entry is added and the index for that new dictionary entry is set to 0. Otherwise, if there is already a dictionary entry, the algorithm just lists a new dictionary entry with an index equal to an existing dictionary entry's index and the character becomes whatever the following character is. Afterwards, a value representing each recorded tuple is stored into a file. The entire process continues until all characters in the input data stream are read.