Looping through random variables

Glad that you get it works. Still you might want to avoid using for loop to improve performance.