added sCurve function