updated KMP algorithm
updated string utilities