function [outputSequence internalResponse esn] = runFNetwork(teacher, steps, esn)
%runNetwork vypocita steps krokov siete
%Vysledkom je vystupna sekvencia outputSequence, ktora zodpoveda vystupu
%siete a internalResponse je odozva jednotlivych neuronov v case


internalResponse = zeros(length(esn.x), steps + length(teacher));
esn.x = zeros(1, esn.nResUnits)';
oi = 0;


for i = 1:length(teacher)
    oi = oi + 1;
     %save the n - th output to outputSequence
    internalResponse(:,oi) = esn.x;
    outputSequence(oi) = esn.y; 
    
    outp=esn.y;
    desired = teacher(i);
    
    % calculate x(n + 1)
    esn.x = unitFunction(esn.resWeights * esn.x + esn.feedbackWeights * teacher(i));
    % calculate y(n + 1)
    esn.y = unitFunction(esn.outWeights * esn.x); %unitFunction(); 
end

% generovanie siete z nahodneho stavu
% esn.x = rand(esn.nResUnits, 1);     

for i = 1:steps
    oi = oi + 1;
     %save the n - th output to outputSequence
    internalResponse(:,oi) = esn.x;
    outputSequence(oi) = esn.y; 
    
    % calculate x(n + 1)
    esn.x = unitFunction(esn.resWeights * esn.x + esn.feedbackWeights * esn.y);
    % calculate y(n + 1)
    esn.y = unitFunction(esn.outWeights * esn.x); %unitFunction(); 
end