 	//
 	if(th_cls_offset<cls_count[th_cls])
 	{		
-		int cls_nr = cls[th_cls];
+		//int cls_nr = cls[th_cls];
 		//true row index in a dataset
-		int row = th_cls_offset+cls_start[cls_nr];
-		
+		//int row = th_cls_offset+cls_start[cls_nr];
+		int row = th_cls_offset+cls_start[cls[th_cls]];
+
 		// //slice number, which particular row belongs in
-		int sliceStartNr = row/SLICE_SIZE;
-		int rowSliceStart=sliceStart[sliceStartNr];
+		//int sliceStartNr = row/SLICE_SIZE;
+		//int rowSliceStart=sliceStart[sliceStartNr];
+		//int rowSliceStart=sliceStart[row/SLICE_SIZE];
 		// //offset of the row in slice
-		int sliceOffset = row% SLICE_SIZE;
+		//int sliceOffset = row% SLICE_SIZE;
 		
 		float preVals[PREFETCH_SIZE]={0.0};
 		int preColls[PREFETCH_SIZE]={-1};

				//wrong index
				//arIdx = (i*PREFETCH_SIZE+j )*align+rowSliceStart+threadIdx.x;
				//corrected version
				arIdx = (i*PREFETCH_SIZE+j )*align+rowSliceStart+sliceOffset*THREAD_PER_ROW+threadIdx.x%THREAD_PER_ROW;
				preColls[j]=colIdx[arIdx];
				preVals[j]=vals[arIdx];
			}

//		{
//					
//			//index within a subset of two considered class
//			int row = th_cls_offset+th_cls*cls_count[0];
//			
//			results[row]=blockIdx.x;
//			results[row+num_rows]=sliceStartNr;
//			
//			// results[row]=row;
//			// results[row+shClsSum]=row+shClsSum;
//			
//		}
//	}
