 	for (int yindex = 0; yindex < BIGgridSize.y; yindex += gridSizeRK4.y) {
 		for (int xindex = 0; xindex < BIGgridSize.x; xindex += gridSizeRK4.x) {
 
-//			std::cout << "Progress was made! " << (yindex*BIGgridSize.x+xindex)/(float)(BIGgridSize.x*BIGgridSize.y) << std::endl;
 			std::cout << "x" << std::flush;
 			float4 startloc = BIGstartloc + ((float)xindex/BIGgridSize.x) * BIGxvec + ((float)yindex/BIGgridSize.y) * BIGyvec;
 			float4 xvec = BIGxvec * ((float)gridSizeRK4.x/BIGgridSize.x);
 			float4 yvec = BIGyvec * ((float)gridSizeRK4.y/BIGgridSize.y);
 
+			int globaloffset = yindex*blockSizeRK4.y*BIGgridSize.x*blockSizeRK4.x+xindex*blockSizeRK4.x;
+
+			int hsize = gridSizeRK4.x*blockSizeRK4.x;
+			int vsize = gridSizeRK4.y*blockSizeRK4.y;
 
 		//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%//
 

//	float4write("../datadir/linedata.bin", BIGdataCount, h_lines);
	name = name.substr(name.rfind("/")+1,name.rfind(".")-name.rfind("/")-1);
	const std::string prefix = "../datadir/";
	const std::string suffix = "_windings.bin";
	const std::string path = prefix+name+suffix;
	floatwrite(path.c_str(), BIGnroflines, h_windingdata);

	status = cudaStreamDestroy(RK4);
	status = cudaStreamDestroy(windings);

				(d_origins,(float)steps, d_origins);//not size-scalable!!!

			//Copy origin data from device to host

		//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%//

