 			#ifndef USE_GPU
 				TRY( VecRestoreArray(y.get_vector(), &values) );
 			#else
-				TRY( VecCUDARestoreArrayReadWrite(y.get_vector(), &values) );
+				TRY( VecRestoreArray(y_Vec, &values) );
 			#endif
 
 		}


	/* create base vector */
	/* try to make a global vector of length T and then get size of local portion */
	Vec x_Vec;
	int Tlocal, Tbegin, Tend;
	Vec layout;
	TRY( VecCreate(PETSC_COMM_WORLD,&layout) );

			#ifndef USE_GPU
				TRY( VecGetArray(y.get_vector(), &values) );
			#else
				/* from GPU to CPU and then get array */
				TRY( VecCopy(y.get_vector(),y_VecCPU) );
				TRY( VecGetArray(y_Vec, &values) );
			#endif
		
			/* print row */
