 	}
 	shurA(mx);
 	real lm;
-	real _obj1 = 0;
-	real temp1 = 0;
-	real temp2 = 0;
+	custom_vector<real> temp1(size);
+	custom_vector<real> temp2(size);
+
+	custom_vector<real> obj2_temp(size);
+	custom_vector<real> obj1_temp(size);
 
 #pragma omp parallel private(lm)
 	{
 		lm=FLT_MAX;
-#pragma omp for reduction(+:_obj1,temp1,temp2)
+#pragma omp for
 		for (uint index = 0; index < number_of_contacts; index++) {
 			real3 temp = R3(0);
 			int2 id_ = ids[index];

			_my.y = my[index+ number_of_contacts * 1];
			_my.z = my[index+ number_of_contacts * 2];

			_obj1 += _obj1_tmp.x * _mx.x;
			_obj1 += _obj1_tmp.y * _mx.y;
			_obj1 += _obj1_tmp.z * _mx.z;

			_ms = _mx - _my;


		ShurProduct(x,mg);
		mg=mg- b;// 1)  g = N*l // 2)  g = N*l - b_shur ...

		Thrust_Fill(mb_tmp, -1.0);
		mb_tmp+=x;
		ShurProduct(mb_tmp,mg_tmp);
