 	cudaThreadSynchronize();
 	CUT_CHECK_ERROR("Kernel execution failed: IntegrateInTimeD");
 #else
-	IntegrateInTimeD __KERNEL__(nBlock_FlexBodies, nThreads_FlexBodies)(
+	IntegrateInTimeD(
 			R3CAST(ANCF_NodesH2), R3CAST(ANCF_SlopesH2), R3CAST(ANCF_NodesVelH2), R3CAST(ANCF_SlopesVelH2),
 			R3CAST(ANCF_NodesVelH), R3CAST(ANCF_SlopesVelH), R3CAST(ANCF_NodesAccH), R3CAST(ANCF_SlopesAccH),
 			I2CAST(ANCF_ReferenceArrayNodesOnBeamsH), BCAST(ANCF_IsCantileverH));
-	cudaThreadSynchronize();
-	CUT_CHECK_ERROR("Kernel execution failed: IntegrateInTimeD");
-#endif
+#endif
+
+	printf("a3\n");
+
 
 	ANCF_NodesAccD.clear();
 	ANCF_SlopesAccD.clear();
 	ANCF_NodesAccH.clear();
 	ANCF_SlopesAccH.clear();
+	printf("a4\n");
 
 	//---------------------------------------------
 

	thrust::copy(ANCF_SlopesH2.begin(), ANCF_SlopesH2.end(), ANCF_SlopesD2.begin());
	thrust::copy(ANCF_NodesVelH2.begin(), ANCF_NodesVelH2.end(), ANCF_NodesVelD2.begin());
	thrust::copy(ANCF_SlopesVelH2.begin(), ANCF_SlopesVelH2.end(), ANCF_SlopesVelD2.begin());

	ANCF_NodesH2.clear();
	ANCF_SlopesH2.clear();
	ANCF_NodesVelH2.clear();
	ANCF_SlopesVelH2.clear();

	ANCF_NodesH.clear();
	ANCF_SlopesH.clear();
	ANCF_NodesVelH.clear();
	ANCF_SlopesVelH.clear();

	flex_FSI_NodesForcesH1.clear();
	flex_FSI_NodesForcesH2.clear();
	ANCF_ReferenceArrayNodesOnBeamsH.clear();
	ANCF_Beam_LengthH.clear();
	ANCF_IsCantileverH.clear();
}

	cudaThreadSynchronize();
	CUT_CHECK_ERROR("Kernel execution failed: SolveAndIntegrateInTime");
#else
	SolveForAccD(
			R3CAST(ANCF_NodesAccH), R3CAST(ANCF_SlopesAccH),
			R3CAST(flex_FSI_NodesForcesH1), R3CAST(flex_FSI_NodesForcesH2),
			I2CAST(ANCF_ReferenceArrayNodesOnBeamsH), R1CAST(ANCF_Beam_LengthH), BCAST(ANCF_IsCantileverH));
#endif

	printf("a2\n");


#if flexGPU
	IntegrateInTimeD __KERNEL__(nBlock_FlexBodies, nThreads_FlexBodies)(
