     pinMode(11, OUTPUT);
     pinMode(12, OUTPUT);
     pinMode(13, OUTPUT);
-}
 
-void loop() {
-    digitalWrite(0, LOW);
-    digitalWrite(1, LOW);
-    digitalWrite(2, LOW);
-    digitalWrite(3, LOW);
-    digitalWrite(4, LOW);
+    digitalWrite( 0, LOW);
+    digitalWrite( 1, LOW);
+    digitalWrite( 2, LOW);
+    digitalWrite( 3, LOW);
+    digitalWrite( 4, LOW);
     digitalWrite(10, LOW);
     digitalWrite(11, LOW);
     digitalWrite(12, LOW);
     digitalWrite(13, LOW);
+}
 
-    start:
+const int MODE0=0;
+const int MODE1=1;
+const int MODE2=2;
+
+int buttonState=1;
+void loop() {
+    static int next_mode = MODE0;
+    if(next_mode==MODE0)      next_mode = start1();
+    else if(next_mode==MODE1) next_mode = music1();
+    else if(next_mode==MODE2) next_mode = music2();
+}
+
+int start1(){
     delay(500);
-    int buttonState=1;
-
-    start1:
     buttonState=digitalRead(9); 
-    if (buttonState ==LOW ) {goto music1;}
+    if (buttonState ==LOW ) return MODE1;
     else{
         analogReference(INTERNAL);
         int x=analogRead(5);

        else{tone(8, 5100,100);}
        delay(1000);
    }
    goto start1;


    music1:
    delay(500);
    buttonState=1;
    for (int thisNote = 0; thisNote < 82; thisNote++) { 
       buttonState=digitalRead(9); 
       if (buttonState ==LOW ) {goto music2;}
       if(thisNote == 0){
            digitalWrite(5,LOW);
            digitalWrite(6,LOW);


    for (int thisNote = 0; thisNote < 68; thisNote++) {
        buttonState=digitalRead(9); 
        if (buttonState ==LOW ) return MODE0;
        digitalWrite(5,HIGH);
        digitalWrite(6,HIGH);
        digitalWrite(7,HIGH);
