fix boyer-moore algorithm