kp detector implemented.