 
 	
 	// directional light source
-	vec3 P = (modelview * position).xyz;
+	vec3 Pos = (modelview * position).xyz;
 	vec4 lightPosition = modelview*(directionArray[0]);
-	vec3 _k2 = normalize(-P);
+	vec3 _k2 = normalize(-Pos);
 	vec3 _k1 = normalize(lightPosition.xyz);
 	vec3 V = _k1 - _k2;
 	float u = V.x; float v = V.y; float w = V.z;

		vec2 modUV = getRotation(u,v,-phi);
		
		// iterate twice: once for N_u and once for N_v lower,upper
		for(variant=0;variant < 2; variant++){
			
			int lower = N_uv[variant].x
			int upper = N_uv[variant].y
			
			for(int iter = lower; iter <= upper; iter++){
				float lambda_iter = dx*abs(u)/iter; 

	float rightNom = dot(_k2, camNormal);
	rightNom = (rightNom > tolerance)? tolerance : ((rightNom < -tolerance) ? -tolerance :  rightNom);
	float nominator = leftNom*rightNom;
	return (dominator / nominator);
}

// assuming we have weigths given foreach lambda in [380nm,700nm] with delta 1nm steps.
vec3 avgWeighted_XYZ_weight(float lambda){
	
	float lambda_a = floor(lambda); // lower bound current lambda
	float lambda_b = ceil(lambda); // upper bound current lambda
	
	// convex combination of a,b gives us the nearest weight for current:
	// (L_b-L)f(L_b) + (L-L_a)f(L_a)
	
	vec3 cie_XYZ_lambda_weight = (lambda_b - lambda)*brdf_weights[int(lambda_b)] + (lambda - lambda_a)*brdf_weights[int(lambda_a)];
	return cie_XYZ_lambda_weight;
}

