update sprime.cpp