New implementation of Gillespie algorithm