   cudaMalloc(&bitmap.pixels, pixelsSize);
 
   int threadsPerBlock1dim, numBlocksX, numBlocksY;
-  threadConfigCalc(maxThreads, threadsPerBlock1dim, numBlocksX, numBlocksY);
+  threadConfigCalc(maxThreads, threadsPerBlock1dim, numBlocksX, numBlocksY, quiet);
 
   dim3 threadsPerBlock(threadsPerBlock1dim, threadsPerBlock1dim);
   dim3 numBlocks(numBlocksX, numBlocksY);
 
-  calc<<<numBlocks, threadsPerBlock>>>(offset, bitmap);
+  calc<<<numBlocks, threadsPerBlock>>>(offset, bitmap, quiet);
 
   cudaDeviceSynchronize();
 

    sscanf(tvalue, "%d", &maxThreads);
  if (filenameArg != NULL)
    sscanf(filenameArg, "%s", filename);
  printf("svalue = %s;%dx%d\nrvalue = %s; %lf, %lf, %lf, %lf\n", svalue, width, height, rvalue, lowerX, upperX, lowerY, upperY);
  printf("tvalue = %s; %d\n", tvalue, maxThreads);
  printf("filenameArg = %s; %s\n", filenameArg, filename);
  printf("quiet = %d\n", quiet);

  //////////////////////////////////

  Offset offset(lowerX, upperX, lowerY, upperY);

  generateImage(width, height, offset, maxThreads, filename, quiet);

  return 0;

      pixel->blue = rgb_value(200 - iter, 1000);
    }
  }

  if (!quiet)
    printf("Thread-%d:%d on block %d:%d finished.\n", threadIdx.x, threadIdx.y, blockIdx.x, blockIdx.y);
}

void threadConfigCalc(int maxThreads, int &threadsPerBlock1dim, int &numBlocksX, int &numBlocksY, bool quiet = false) {
  double sqroot = sqrt(maxThreads);
  threadsPerBlock1dim = exp2(fmin(floor(log2(sqroot)), 4));
  numBlocksY = floor(sqroot / threadsPerBlock1dim);
  numBlocksX = floor((double)maxThreads / (threadsPerBlock1dim * threadsPerBlock1dim * numBlocksY));

  if (!quiet)
    printf("%d <= %d, threadsPerBlock: %dx%d, numBlocksXxnumBlocksY: %dx%d\n",
      threadsPerBlock1dim * threadsPerBlock1dim * numBlocksX * numBlocksY, maxThreads, threadsPerBlock1dim, threadsPerBlock1dim, numBlocksX, numBlocksY);
}

void generateImage(int width, int height, Offset offset, int maxThreads, const char* filename, bool quiet) {
