Improved on the sequence searching algorithm