added bayer moore algorithm implementation