 	float3 v = cross(normal, u);
 	float3 w = normal;
 
-	// Create random coordinates in the local coordinate system
-	float rand = curand_uniform(randState);
-	float r = sqrt(rand);
-	float theta = curand_uniform(randState) * TWO_PI; 
-	
-	float x = r * cos(theta);
-	float y = r * sin(theta);
-    
 
 	// Transform from local coordinates to world coordinates
     return normalize(u * x +

 * @return              A uniformly random direction in the hemisphere
 */
__device__ float3 CreateUniformDirectionInHemisphere(float3 normal, curandState *randState) {	
	// Find an axis that is not parallel to normal
	float3 majorAxis;
	if (abs(normal.x) < INV_SQRT_THREE) { 

	float3 u = normalize(cross(majorAxis, normal));
	float3 v = cross(normal, u);
	float3 w = normal;

	// Transform from spherical coordinates to the cartesian coordinates space
	// we just defined above, then use the definition to transform to world space
