 void cleanOutput() {
   // Switch off all outputs
   for (int i = 0; i < DIFFERENT_VALUES; i++) {
-    digitalWrite(i, LOW);
+    digitalWrite(i + FIRST_OUTPUT, LOW);
   }
 }
 
 // Show the current sequence (up to current length)
 void showSequence() {
-  setMode(OUTPUT);
+  digitalWrite(13, LOW);
   for (int i = 0; i < currentLength; i++) {
     cleanOutput();
     delay(SHOW_DELAY);
     // Switch on current output
-    digitalWrite(sequence[i], HIGH);
+    digitalWrite(sequence[i] + FIRST_OUTPUT, HIGH);
     delay(SHOW_DELAY);
   }
   cleanOutput();
+  delay(SHOW_DELAY * 3);
 }
 
 void waitForUnpush() {

  while (allInputsAreUnpushed == 0) {
    allInputsAreUnpushed = 1;
    for (int i = 0; i < DIFFERENT_VALUES; i++) {
      if (digitalRead(i) ==  HIGH) {
        // At least one input is not unpushed
        allInputsAreUnpushed = 0;
        // Doesn't read other inputs
        break;
      }
    }
  }
}


  int pushedElement = -1;
  while (pushedElement == -1) {
    for (int i = 0; i < DIFFERENT_VALUES; i++) {
      // Value to check must be LOW, because input is pull up
      if (digitalRead(i + FIRST_INPUT) ==  LOW) {
        // Waits some milliseconds to prevent bouncing
        delay(DEBOUNCE_DELAY);
        // Pusher is still pushed
        if (digitalRead(i + FIRST_INPUT) ==  LOW) {
          pushedElement = i;
          waitForUnpush();
          // Doesn't read other inputs
          break;
        }
      }
    }
    delay(READ_WAITING_DELAY);
  }
  return pushedElement;
}

void blinkCorrectElement(int element) {
  while (true) {
    digitalWrite(element + FIRST_OUTPUT, HIGH);
    delay(BLINK_DELAY);
    digitalWrite(element + FIRST_OUTPUT, LOW);
    delay(BLINK_DELAY);
  }
}

void readSequence() {
  digitalWrite(13, HIGH);
  for (int i = 0; i < currentLength; i++) {
    int pushed = readFirstPushed();
    if (sequence[i] != pushed) {
      // Wrong element, game over
      Serial.println("Game over");
      Serial.print("Sequence was ");
      Serial.print(sequence[i]);
