Ksm base

Add three sub cases for KSM