stochastic Gillespie algorithm