     cv::Mat mInLeft = cv::imread(imageLeft.c_str(), (gray? CV_LOAD_IMAGE_GRAYSCALE : -1));
     // Load the input image using opencv (load as grayscale if "gray==true", otherwise as is (may be color or grayscale))
     cv::Mat mInRight = cv::imread(imageRight.c_str(), (gray? CV_LOAD_IMAGE_GRAYSCALE : -1));
-    // check
+    // check if both images are loaded
     if (mInLeft.data == NULL || mInRight.data == NULL) { cerr << "ERROR: Could not load one or more image(s) specified" << endl; return 1; }
     
 #endif

    mInLeft /= 255.f;
    mInRight /= 255.f;

    // get image dimensions - left and right must have same dimensions
    if(mInLeft.cols != mInRight.cols || mInLeft.rows != mInRight.rows) {cerr << "ERROR: Image dimensions don't match!" << endl; return 1; }
    int w = mInLeft.cols;         // width
    int h = mInLeft.rows;         // height
    int nc = mInLeft.channels();  // number of channels
    cout << "images: " << w << " x " << h << endl;


    //cv::Mat mOut(h,w,mInLeft.type());  // mOut will have the same number of channels as the input image, nc layers
    //cv::Mat mOut(h,w,CV_32FC3);    // mOut will be a color image, 3 layers
    // ### Define your own output images here as needed
    cv::Mat mOutDepth(h, w, CV_32FC1);    // mOut will be a color image, 3 layers




    // Allocate arrays
    // input/output image width: w
    // input/output image height: h
    // input image number of channels: nc
    // output image number of channels: mOut.channels(), as defined above (nc, 3, or 1)

    // allocate raw input image array
    float *imgInLeft  = new float[(size_t)w * h * nc];
    float *imgInRight  = new float[(size_t)w * h * nc];

    // allocate raw output array (the computation result will be stored in this array, then later converted to mOut for displaying)
    float *imgOutDepth  = new float[(size_t)w * h * mOutDepth.channels()];


    if (argc <= 1) { cout << "Usage: " << argv[0] << " -i_left <image> -i_right <image> [-repeats <repeats>] [-gray]" << endl; return 1; }
#endif
    
    // suppress all outputs by program except file writes and errors
    bool suppressOut = false;
    getParam("suppress_out", suppressOut, argc, argv);
    cout << "Suppress Out: " << suppressOut << endl;

    // number of computation repetitions to get a better run time measurement
    int repeats = 1;
    getParam("repeats", repeats, argc, argv);
    
    
    // load the input image as grayscale if "-gray" is specifed
    bool gray = false;
    getParam("gray", gray, argc, argv);

    // ### Define your own parameters here as needed    
    // get MU
    float MU;
    bool retVal = getParam("mu", MU, argc, argv);
    if (!retVal) {
        cerr << "ERROR: no MU specified" << endl;
        cout << "Usage: " << argv[0] << " -mu <value> " << endl; return 1;
    }

    // get sigma
    float SIGMA;
    retVal = getParam("sigma", SIGMA, argc, argv);
    if (!retVal) {
        cerr << "ERROR: no SIGMA specified" << endl;
    cout << "Usage: " << argv[0] << " -sigma <value>" << endl; return 1;
    }

    // get TAU
    float TAU;
    retVal = getParam("tau", TAU, argc, argv);
    if (!retVal) {
        cerr << "ERROR: no TAU specified" << endl;
    cout << "Usage: " << argv[0] << " -tau <value>" << endl; return 1;
    }

    // get discretization
    uint32_t nt;
    retVal = getParam("nt", nt, argc, argv);
    if (!retVal) {
        cerr << "ERROR: no discretization specified" << endl;
        cout << "Usage: " << argv[0] << " -nt <value>" << endl; return 1;
    }

    // get steps
    uint32_t steps;
    retVal = getParam("steps", steps, argc, argv);
    if (!retVal) {
        cerr << "ERROR: no step specified" << endl;
        cout << "Usage: " << argv[0] << " -steps <value>" << endl; return 1;
    }

    // get implementation type
    int impl;
    retVal = getParam("impl", impl, argc, argv);
    if (!retVal) {
        cerr << "ERROR: no implementation specified" << endl;
        cout << "Usage: " << argv[0] << " -impl <value> {0:'Global Memory', 1:'Texture', 2:'Pitch', 3:'Shared Memory', 4:'2D Grid'}" << endl; return 1;
    }

    if(!suppressOut) {
        // output parameters
        cout << "repeats: " << repeats << endl;
        cout << "gray: " << gray << endl;
        cout << "MU: " << MU << endl;
        cout << "SIGMA: " << SIGMA << endl;
        cout << "TAU: " << TAU << endl;
        cout << "nt: " << nt << endl;
        cout << "Steps: " << steps << endl;
        cout << "Impl: " << impl << endl;

    }

    // Init camera / Load input image
#ifdef CAMERA
