Test (improved) KSM algorithm

Change-Id: I3eeac234723a62bbfb242082dedd45296712241e