KMP and Z-function were added