shorter KPK recognizer code

still needs more clauses though