function outText = checkEpisodesCoupling(match)
    persistent lastVals
    
    if ~nargin
        outText = 'PSP Coupling';
        return
    end

    if isempty(lastVals)
        lastVals = {'.5', '3', '1', '1'};
    end
    
    whereBounds = inputdlg({'Window Delay (msec)', 'Window Length (msec)', 'Fitting Option'},'',1, lastVals);
    
    if ~isempty(whereBounds)
        lastVals = whereBounds;
        windowDelay = str2double(whereBounds{1});
        windowLength = str2double(whereBounds{2});
        fittingOption = str2double(whereBounds{3});
        % find all files in this directory that meet this criterion
        path = match(1:find(match == '\', 1, 'last'));
        fileNames = dir(path(1:end - 1));
        match = match(find(match == '\', 1, 'last') + 1:end);
        for i = 1:length(fileNames)
           if ~isempty(strfind(fileNames(i).name, match)) && (strcmp(fileNames(i).name(end - 3:end), '.dat') || strcmp(fileNames(i).name(end - 3:end), '.mat'))
               checkCoupling([path fileNames(i).name], windowLength, windowDelay, [fittingOption 1 1 1]);
           end
        end
    end