Addding updated code for rahtu and randomizedPrims