added karp-rabin algorithm