function [work] = overviewPlot(sigmaData, diagDecay, work, user)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% indexing %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

diagDecayIndices         = find(arrayfun(@(x) ~isempty(x.DPrho), diagDecay));

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Plotting %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

hfig                                = figure(work.numberOfFig);

set(hfig,'Position',[5,5,700,700])

work.numberOfFig                    = work.numberOfFig + 1;

if ~isempty(diagDecayIndices)...
        && isempty(user.IzeroMethyl)... 
        && isempty(user.IzeroMethylenePseudo) ...
        && isempty(user.IzeroSingle)
    
    fprintf('\nPloting a few decays and buildups\n')
    
    % Plotting the first three decays if available
    temp.subplotZ                   = 1;
        
    for j = diagDecayIndices
            
        if temp.subplotZ <= 3 && temp.subplotZ <= length(diagDecayIndices)
            temp.B                  = j;
            
                basicDecayPlot
                temp.subplotZ       = temp.subplotZ + 1;
         end
        
    end

    % Plotting the first six buildups
    temp.subplotZ                   = 4;
        
    for j = 1:length(sigmaData)
        temp.B                      = j;
        
        if temp.B <= length(sigmaData) && temp.subplotZ <= 9
            if abs(sigmaData(temp.B).buildups.rawIzero) ~= 999
                basicBuildupPlot
                temp.subplotZ       = temp.subplotZ + 1;
            end
            
            temp.B                  = temp.B + 1;
        end
    end
end

if isempty(diagDecayIndices) ...
        || (~isempty(user.IzeroMethyl)... 
        && ~isempty(user.IzeroMethylenePseudo) ...
        && ~isempty(user.IzeroSingle))
    fprintf('\n\nNo diag decays to plot, ploting a few buildups\n\n')
    % Plotting the first six buildups

    temp.B                          = 1;
    temp.subplotZ                   = 1;

    while temp.subplotZ <= 9
        
        if temp.B <= length(sigmaData) 
            
            if abs(sigmaData(temp.B).buildups.rawIzero) ~= 999
                basicBuildupPlot
                temp.subplotZ       = temp.subplotZ + 1;
            end
    
            temp.B                  = temp.B + 1;
        end
    end
end

hold('off')

drawnow
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%        
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%        
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%       