KMP one pass improvement, TESTED, ACCEPTED