   //int chunk_size = image_size / N;
 
   // Prepare CPU output array:
-  if (mode != 4) {
+  if (mode != 5) {
     new_image = (uchar*)malloc( image_height*image_width*sizeof(uchar) );
   }
-  else if (mode == 4) {
+  else if (mode == 5) {
     // need to use pinned memory for streaming
     checkCudaErrors( cudaMallocHost((void**)&new_image, image_height*image_width*sizeof(uchar)) );
   }


  ///////////////////////////// Clean up and exit: /////////////////////////////

  if (mode != 4) {
    free(new_image);
  }
  else if (mode == 4) {
    checkCudaErrors( cudaFreeHost(new_image) );
  }
  if (mode > 1) {


  if ((mode == 2) || 
      (mode == 3) || 
      (mode == 4)) { ///////////////// Non-streaming examples //////////////////

    // Copy input image to GPU:
    checkCudaErrors(  cudaMemcpy( old_image_G,
