KMP now fully working.

According to Raphael's notes.