More common are methods where the dictionary starts in some predetermined state but the contents change during the encoding process, based on the data that has already been encoded. Both the LZ77 and LZ78 algorithms work on this principle. In LZ77, a circular buffer called the "sliding window" holds the last "N" bytes of data processed. This window serves as the dictionary, effectively storing "every" substring that has appeared in the past "N" bytes as dictionary entries. Instead of a single index identifying a dictionary entry, two values are needed: the "length", indicating the length of the matched text, and the "offset" (also called the "distance"), indicating that the match is found in the sliding window starting "offset" bytes before the current text.