implment horspool alogrithm