 	movingIdx = 0;
 	for( uint winIdx = 0; winIdx < nShards; ++winIdx ) {
 		for( uint shardIdx = 0; shardIdx < nShards; ++shardIdx ) {
-			std::vector<shard_entry>& window = graphShards.at( shardIdx ).at( winIdx );
+			std::vector<shard_entry>& window = graphWindows.at( shardIdx * nShards + winIdx );
 			uint inWinMovingIdx = 0;
 			for( uint entryIdx = 0; entryIdx < window.size(); ++entryIdx ) {
 				if( procesingMethod == CW ) {

	host_pinned_buffer<Vertex> vertexValue( nVertices );
	std::vector<Vertex_static> tmpVertexValueStatic;
	if( sizeof(Vertex_static) > 1 ) tmpVertexValueStatic.resize( nVertices );
	std::vector< std::vector< std::vector<shard_entry> > > graphShards( nShards, std::vector< std::vector<shard_entry> >(nShards) );

	// Collecting graph data into shard form.
	for( uint vIdx = 0; vIdx < nVerticesInitially; ++vIdx ) {

			if( sizeof(Edge) > 1 ) tmpShardEntry.edgeVal = nbr.edgeValue;
			uint belongingShardIdx = ( static_cast<unsigned long long>( tmpShardEntry.dstIdx ) * nShards ) / nVertices;
			uint belongingWindowIdx = ( static_cast<unsigned long long>( tmpShardEntry.srcIdx ) * nShards ) / nVertices;
			graphWindows.at( belongingShardIdx * nShards + belongingWindowIdx ).push_back( tmpShardEntry );
		}
	}
	initGraph->clear();
