commit the original version of K.M.P. algorithm