Corrected the mk_stochastic function