             for(int i=0; i<D; i++) {
                 float sum = 0;
                 for(int j=0; j<=i; j++) {
-				  // printf("%d %d %f %f %f\n", i, j, *tSigma, tData[j], tMean[j]);
-				  sum += *tSigma * (tData[j] - tMean[j]); // xx[j] is always calculated since j <= i
-				  tSigma++;
+                  // printf("%d %d %f %f %f\n", i, j, *tSigma, tData[j], tMean[j]);
+                  sum += *tSigma * (tData[j] - tMean[j]); // xx[j] is always calculated since j <= i
+                  tSigma++;
                 }
 
                 discrim += sum * sum;
             }
 
             float d = log(tP) - 0.5 * (discrim + tLogDet + (LOG_2_PI*(float) D));
-			// printf("discrim: %f\n", discrim);
-			// printf("tP: %f\n", tP);
-			// printf("tLogDet: %f\n", tLogDet);
-			// printf("d: %f\n", d);
-			// printf("idx: %d\n", obs * T + component);
+            // printf("discrim: %f\n", discrim);
+            // printf("tP: %f\n", tP);
+            // printf("tLogDet: %f\n", tLogDet);
+            // printf("d: %f\n", d);
+            // printf("idx: %d\n", obs * T + component);
             output[obs * T + component] = d;
         }
     }
-	free(xx);
+    free(xx);
 }
 
 

  int max_block_params = 16;
  int params_per = max_block_params;
  if (params->rows < max_block_params)
	params_per = next_pow2(params->rows, max_block_params);

  // hide your kids, hide your wife (auto-tuning the GPU)
  int data_per;
  while (1) {
	data_per = max_threads / params_per;
	  while (compute_shmem(data, params, params_per, data_per) > max_smem) {
		if (data_per == 0)
		  break;
		data_per /=2;
	  }

	  // can't fit max_block_params sets of parameters into the shared memory,
	  // uh oh
	  if (data_per == 0) {
		params_per /= 2;

		// start over the tuning
		continue;
	  }
	  else break;
  }

  info->data_per_block = data_per;

  cudaFree(d_pdf);
}

void cpu_mvnormpdf(float* x, float* density, float * output, int D, int N, int T) {
    int LOGDET_OFFSET = D * (D + 3) / 2;
    int MEAN_CHD_DIM = D * (D + 3) / 2  + 2;
    int PACK_DIM = 16;

    while (MEAN_CHD_DIM > PACK_DIM) {PACK_DIM += 16;}
    int DATA_PADDED_DIM = 8;
    while (D > DATA_PADDED_DIM) {DATA_PADDED_DIM += 8;}

    float* xx = (float*) malloc(D * sizeof(float));
    int obs, component;
