 
             //do we even care about the fast_line_search?
 		    assert(params.type == minimization_params::BFGSAccurateLineSearch);
-            cudaDeviceSynchronize();
         }
+        __syncthreads();
+        cudaDeviceSynchronize();
 		alpha = accurate_line_search_gpu(f, n, x, g, f0,
                                                 p, x_new, g_new, f1);
 		if(alpha == 0) 

    if (threadIdx.x == 0) {
        minus_hy = y;
	    y.minus_mat_vec_product(h, minus_hy);
        cudaDeviceSynchronize();
    }

	const fl yhy = -y.dot(minus_hy);
    if (threadIdx.x == 0) {

    }
	for (;;) //always try full newton step first
	{
        if (threadIdx.x == 0) 
		    x_new = x;

        __syncthreads();
        cudaDeviceSynchronize();

        if (threadIdx.x == 0) 
		    x_new.increment(p, alpha);

        __syncthreads();
        cudaDeviceSynchronize();

        //TODO: remove temp variable
		fl ftemp = f(x_new, g_new);
