Added semi-kmp and semi-hst code