updates function signature of d1 and d2 functions
Merge pull request #231 from jrjohansson/stochastic-updates

update function signature of d1 and d2 functions