 	//create outputs
 	
 	if (nlhs > 2)
-		rintmode = true;
+		record_min_intensity = true;
 	else
-		rintmode = false;
+		record_min_intensity = false;
 	if (nlhs > 4)
 		record_intensity_at_best_focus = true;
 	else

	focus_metric = (float*) mxGetPr(plhs[0]);
	index_of_max_focus_metric = (short*) mxGetPr(plhs[1]);

	if (rintmode) {
		plhs[2] = mxCreateNumericMatrix(N, M, mxSINGLE_CLASS, mxREAL);
		plhs[3] = mxCreateNumericMatrix(N, M, mxINT16_CLASS, mxREAL);
		min_intensity_cpu = (float*) mxGetPr(plhs[2]); //single

	//C is column-wise ordering (column-major)
	
	//retrieve the depths at which to do reconstructions
	reconstruction_z_depths = mxGetPr(prhs[1]);
	num_z_depths = mxGetM(prhs[1]) * mxGetN(prhs[1]);
	
	//mexPrintf("M: %i, N: %i, num_z_depths: %i\n", M, N, num_z_depths);

	//get optional parameters; use defaults otherwise
	if (nrhs>=3)
