   }
 }
 
+// listen to the buttons pressed by the user
 boolean inputFromUser(int level) {
   boolean wrong = false;
   int seqIndex = 0;

 #include "pitches.h"


const int NUM_LEDS = 3;
const int speakerPin = 10;

int buttonPin[] = {3, 2, 4};
int ledPin[] = {13, 8, 9};
int tones[] = {NOTE_C4, NOTE_A4, NOTE_G3};

int buttonState[] = {HIGH, HIGH, HIGH};
int lastButtonState[] = {LOW, LOW, LOW};
boolean buttonOn[] = {false, false};

int sequence[] = {0, 1, 0, 2, 2, 1, 0};
int max_level = 7;
int level = 1;


  else {
    playWinningSequence();
  }
 
}

// play the sequence till the level the user has reached 
void playSequence(int level) {
  for (int i = 0; i < level; i++) {
    int ledNum = sequence[i];
