     tft.setTextColor(ILI9341_GREEN);
     tft.printf("%d", DEFAULT_ECG_MAX + biasECGMax);
   }
-  ECGPlus1.draw();
-  ECGMinus1.draw();
-  createHLabel(184, 72, "-", 2, ILI9341_WHITE);
-  createHLabel(254, 72, "+", 2, ILI9341_WHITE);
-}
-
-void SP02Settings_setup(void){
-  /* MINIMUM VALUE */
-  if (DEFAULT_ECG_MIN + biasECGMin < 100){
-    tft.setCursor(63, 72);
-    tft.setTextSize(2);
-    tft.setTextColor(ILI9341_GREEN);
-    tft.printf("%d", DEFAULT_ECG_MIN + biasECGMin);
-  }
-  if (DEFAULT_ECG_MIN + biasECGMin > 99){
-    tft.setCursor(56, 72);
-    tft.setTextSize(2);
-    tft.setTextColor(ILI9341_GREEN);
-    tft.printf("%d", DEFAULT_ECG_MIN + biasECGMin);
-  }
-  createVLabel(0, 55, ecgLabel, 2, ILI9341_GREEN);
-  ECGPlus.draw();
-  ECGMinus.draw();
-  createHLabel(34, 72, "-", 2, ILI9341_WHITE);
-  createHLabel(104, 72, "+", 2, ILI9341_WHITE);
-  
-  /* MAXIMUM VALUE */
-  if (DEFAULT_ECG_MAX + biasECGMax < 100){
-    tft.setCursor(213, 72);
-    tft.setTextSize(2);
-    tft.setTextColor(ILI9341_GREEN);
-    tft.printf("%d", DEFAULT_ECG_MAX + biasECGMax);
-  }
-  if (DEFAULT_ECG_MAX + biasECGMax > 99){
-    tft.setCursor(206, 72);
-    tft.setTextSize(2);
-    tft.setTextColor(ILI9341_GREEN);
-    tft.printf("%d", DEFAULT_ECG_MAX + biasECGMax);
-  }
-  ECGPlus1.draw();
-  ECGMinus1.draw();
+  //ECGPlus1.draw();
+  //ECGMinus1.draw();
   createHLabel(184, 72, "-", 2, ILI9341_WHITE);
   createHLabel(254, 72, "+", 2, ILI9341_WHITE);
 }

      }
}
void isr(void) {
  if (currentMode == 0 && confirm_button.isTapped(p.x,p.y)){
        currentMode = 1;
  }
  if (currentMode == 1 && alarm_button.isTapped(p.x,p.y)){
        currentMode = 0;
  }    
}


void loop(void) {
  /*main screen*/
  if (currentMode == 1){
    MainScreenInit();
    while (currentMode == 1){
      dispECGWave();
      // Retrieve the touch point
      p = getFixedCoordinates();

    }
  }
  /*alarm screen*/
  if (currentMode == ALARMSCREEN){
    SettingsScreenInit();
    while(currentMode == ALARMSCREEN){
      p = getFixedCoordinates();
      if(ECGPlus.isTapped(p.x,p.y)){
        biasECGMin += 1;
        /*for two digit numbers*/
        if (DEFAULT_ECG_MIN + biasECGMin < 100){
          tft.fillRect(56, 72, 45, 20, ILI9341_BLACK);
          tft.setCursor(63, 72);
          tft.setTextSize(2);
          tft.setTextColor(ILI9341_GREEN);
          tft.printf("%d", DEFAULT_ECG_MIN + biasECGMin);
            if (ts.bufferEmpty()){
        p.x = 0;
        p.y = 0;
      }
        }
        else if (DEFAULT_ECG_MIN + biasECGMin > 99){
          /*for three digit numbers*/
          tft.fillRect(56, 72, 45, 20, ILI9341_BLACK);
          tft.setCursor(56, 72);
          tft.setTextSize(2);
          tft.setTextColor(ILI9341_GREEN);
          tft.printf("%d", DEFAULT_ECG_MIN + biasECGMin);
            if (ts.bufferEmpty()){
        p.x = 0;
        p.y = 0;
      }
        }
      }
    
      /*if(ECGMinus.isTapped(p.x,p.y)){
      biasECGMin -= 1;
      //for two digit numbers
        if (DEFAULT_ECG_MIN + biasECGMin < 100){
          tft.setCursor(63, 72);
          tft.setTextSize(2);
          tft.setTextColor(ILI9341_GREEN);
          
          tft.printf("%d", DEFAULT_ECG_MIN + biasECGMin);
        }
        if (DEFAULT_ECG_MIN + biasECGMin > 99){
          //for three digit numbers
          tft.setCursor(56, 72);
          tft.setTextSize(2);
          tft.setTextColor(ILI9341_GREEN);
          tft.printf("%d", DEFAULT_ECG_MIN + biasECGMin);
        }
      }*/
      
      /*before the isr was implemented*/
      //TS_Point p = ts.getPoint();
      // Scale from 0-4000 to tft.width() using calibration numbers
      //p.x = tft.height() - map(p.x, TS_MINX, TS_MAXX, 0, tft.height());
