     cuda_ret = cudaMalloc((void**)&(outputData_d), OUTPUT_TILE_X * OUTPUT_TILE_Y * OUTPUT_TILE_Z * sizeof(PPMPixel));
     if(cuda_ret != cudaSuccess) FATAL("Unable to allocate device memory");
 
-    /*PPMImage *outImage;
-    outImage = (PPMImage *)malloc(sizeof(PPMImage));
-    outImage->x = image->x;
-    outImage->y = image->y;*/
-
     cudaMemcpyToSymbol(filter_c, filter_h, sizeof(Filter3D));
     cudaDeviceSynchronize();
     dim3 dim_block(BLOCK_SIZE, BLOCK_SIZE, INPUT_TILE_Z);

                  (INPUT_TILE_Y + 1) / BLOCK_SIZE + 1,
                  1);

    for (int z = 0; z < totalFrames; z+=OUTPUT_TILE_Z)
    {
        loadFrames(inputFrames, z, totalFrames);

        }
        writeFrames(outputFrames, z, totalFrames);
    }
    end = clock();

    free(inputData_h);
    free(outputData_h);
    for (int i = 0; i < INPUT_TILE_Z; i++)
        free(inputFrames[i].data);
    for (int i = 0; i < OUTPUT_TILE_Z; i++)
        free(outputFrames[i].data);
    cudaFree(imageData_d);
    cudaFree(outputData_d);

    time_spent = (double)(end - begin) / CLOCKS_PER_SEC;
    printf("%f seconds spent\n", time_spent);

    if (!system(NULL)) { exit (EXIT_FAILURE);}
    sprintf(ffmpegString, "ffmpeg -framerate 24 -i ../outfiles/tmp%%03d.ppm -c:v libx264 -r 30 -pix_fmt yuv420p ../outfilter.mp4");
    system (ffmpegString);
}