KMP table computation and deeper explanations in comments