suppose for a given alignment of p and t, a substring t of t matches a suffix of p, but a mismatch occurs at the next comparison to the left. then find, if it exists, the right-most copy t' of t in p such that t' is not a suffix of p and the character to the left of t' in p differs from the character to the left of t in p. shift p to the right so that substring t' in p aligns with substring t in t. if t' does not exist, then shift the left end of p past the left end of t in t by the least amount so that a prefix of the shifted pattern matches a suffix of t in t. if no such shift is possible, then shift p by n places to the right. if an occurrence of p is found, then shift p by the least amount so that a "proper" prefix of the shifted p matches a suffix of the occurrence of p in t. if no such shift is possible, then shift p by n places, that is, shift p past t.