redefine ksp as function