Different python functions for monte carlo simulations