I have the following code creating a random number from a uniform distribution, using that result to create a random number from a triangular distribution and then repeating