  * @return              A cosine weighted random direction in the hemisphere
  */
 __device__ float3 CreateCosineWeightedDirectionInHemisphere(float3 normal, curandState *randState) {
+	// 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);
+    
+
 	// Find an axis that is not parallel to normal
 	float3 majorAxis;
 	if (abs(normal.x) < INV_SQRT_THREE) { 

 * @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
