new stoch function