 } 
 
 void updateLCD() {
-  // scroll left to right
-  strTitleDisplay = strTitleDisplay.charAt(strTitleDisplay.length() - 1) + strTitleDisplay.substring(0, strTitleDisplay.length() - 1);
-  
   if (bTimerDone) {
-    strGradDisplay = strGradDisplay.charAt(strGradDisplay.length() - 1) + strGradDisplay.substring(0, strGradDisplay.length() - 1);
-  }
-  
-  // first line, display title
-  if (bTimerDone) {
-     mySerial.print(strGradDisplay);       // first line, display congrats
-     mySerial.write(148);                  // new line
-     
-     int spaceCount = 16 - strTime.length() - 2;
-     String strSpace = "";
-     for (int i = 0; i < spaceCount; i++) {
-       strSpace += " ";
-     }     
-     
-     // format DD:HH:MM:SS
-     String strD = printDigits(0, true);
-     String strH = printDigits(0, true);
-     String strM = printDigits(0, true);
-     String strS = printDigits(0, false);
-     strTime = strD+strH+strM+strS;
-     
-     // second line, display time and initials
-     strLine2 = strTime + strSpace + "PK";
-     mySerial.print(strLine2);
-     Serial.println("Time: " + strTime);   // console debug
+    if (scrollDirection == 0) {
+      // scroll text right to left
+      strGradDisplay = strGradDisplay.substring(1, strGradDisplay.length()) + strGradDisplay.charAt(0);
+    } else if (scrollDirection == 1) {
+      // scroll text left to right
+      strGradDisplay = strGradDisplay.charAt(strGradDisplay.length() - 1) + strGradDisplay.substring(0, strGradDisplay.length() - 1);
+    }
+    
+    mySerial.print(strGradDisplay);       // first line, display congrats
+    mySerial.write(148);                  // new line
+    
+    int spaceCount = 16 - strTime.length() - 2;
+    String strSpace = "";
+    for (int i = 0; i < spaceCount; i++) {
+      strSpace += " ";
+    }     
+    
+    // format time in DD:HH:MM:SS
+    strTime = formateClockTime(0, 0, 0, 0);
+    
+    // second line, display time and initials
+    strLine2 = strTime + strSpace + "PK";
+    mySerial.print(strLine2);
+    Serial.println("Time: " + strTime);   // console debug
   } else {
-     mySerial.println(strTitleDisplay);
-     int spaceCount = 16 - strTime.length() - 2;
-     String strSpace = "";
-     for (int i = 0; i < spaceCount; i++) {
-       strSpace += " ";
-     }
-     
-     // second line, display time and initials
-     strLine2 = strTime + strSpace + "PK";
-     mySerial.print(strLine2);
-     Serial.println("Time: " + strTime);   // console debug
+    if (scrollDirection == 0) {
+      // scroll text right to left
+      strTitleDisplay = strTitleDisplay.substring(1, strTitleDisplay.length()) + strTitleDisplay.charAt(0);
+    } else if (scrollDirection == 1) {
+      // scroll text left to right
+      strTitleDisplay = strTitleDisplay.charAt(strTitleDisplay.length() - 1) + strTitleDisplay.substring(0, strTitleDisplay.length() - 1);
+    }
+    
+    mySerial.println(strTitleDisplay);
+    int spaceCount = 16 - strTime.length() - 2;
+    String strSpace = "";
+    for (int i = 0; i < spaceCount; i++) {
+      strSpace += " ";
+    }
+    
+    // second line, display time and initials
+    strLine2 = strTime + strSpace + "PK";
+    mySerial.print(strLine2);
+    Serial.println("Time: " + strTime);   // console debug
   }
 }
 

  setupTime();                                            // setup time left
  delay(100);
  
  // pad title string with 16 whitespaces in the front
  int padding = strTitle.length() % 16;
  
  // scroll left to right
  for (int i = 0; i < padding; i++) {
     strTitleDisplay = " " + strTitleDisplay;
  }
  
  // pad title string with 16 whitespaces in the front
  padding = strGrad.length() % 16;
  
  // scroll left to right
  for (int i = 0; i < padding; i++) {
     strGradDisplay = " " + strGradDisplay;
  }
}


  return formateClockTime(daysLeft, h, m, s);
}

// format time in DD:HH:MM:SS
String formateClockTime(int days, int hours, int minutes, int seconds) {
  return printDigits(days, true) + printDigits(hours, true) + printDigits(minutes, true) + printDigits(seconds, false);
}
