updated from ksolver