more formally, the algorithm begins at alignment , so the start of is aligned with the start of . characters in and are then compared starting at index in and in , moving backward. the strings are matched from the end of to the start of . the comparisons continue until either the beginning of is reached (which means there is a match) or a mismatch occurs upon which the alignment is shifted forward (to the right) according to the maximum value permitted by a number of rules. the comparisons are performed again at the new alignment, and the process repeats until the alignment is shifted past the end of , which means no further matches will be found.