file for stochastic functions