Improved stochastic implementation