   return wrong;
 }
 
+// play a tone and light a LED
 void play(int ledNum, int toneValue) {
   tone(speakerPin, toneValue);
   digitalWrite(ledNum, HIGH);

  }
}


void loop(){

  boolean wrong = false;
  generateSequence();

  while (!wrong && level <= max_level) {
    playSequence(level);
    wrong = inputFromUser(level);

  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];
