reviewed kmp, stylistic fixes