         displayingSequence = false;
         repeatingSequence = true;
         listeningToButtons = true;
-        for (int i = 0; i < seqLength; i ++)
-        {
-          btnLog[i] = -1;
-        }
-        btnLogIndex = 0;
+        resetButtonLog();
         seqIndex = 0;
       }
       timeLEDlastChanged = millis();

      if(animationIndex == (endI + 1))
      {
        displayResultAnimation = false;
        creatingSequence = true;
        listeningToButtons = true;
      }
      timeLEDlastChanged = millis();
    }

const int led2 = 10;
const int led3 = 11;

const int morLed = 12;
const int morBtn = 7;
const int morBuz = 6;


int btn[] = {btn0, btn1, btn2, btn3};
int led[] = {led0, led1, led2, led3};

