 }
 
 void loop() {  
-  
+
   //when characters arrive over the serial port...
   if (Serial.available()) {
-    
-    //wait a bit for the entire message to arrive
-    delay(200);
+
+    //wait for the entire message to arrive
+    delay(MESSAGE_WAIT);
     
     //clear the screen
     lcd.setCursor(0, 0);

#include <LiquidCrystal.h>

//initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  //set up the LCD's number of columns and rows: 
  lcd.begin(16, 2);
  
  //initialize the serial communications:
  Serial.begin(9600);
  
  //print something once we're ready to roll just to keep the user informed
  lcd.noAutoscroll();

    }
    
    if (content != "") {
      //split into two strings
      int newLineIndex = content.indexOf("<~>");
      
      String lineOne = content.substring(0, newLineIndex);
      String lineTwo = content.substring(newLineIndex + 3);
      
      //print to display
      lcd.print(lineOne);
      lcd.setCursor(0, 1);
      lcd.print(lineTwo);
      
      //scroll directionally if either line > DISPLAY_COLUMNS
      if (lineOne.length() > DISPLAY_COLUMNS || lineTwo.length() > DISPLAY_COLUMNS) {
        int scrollSize = 0;
        
        //figure out which line is longer and set that to the scroll size
        if(lineOne.length() > lineTwo.length()) {
          scrollSize = (lineOne.length() - DISPLAY_COLUMNS);
        }
        else {
          scrollSize = (lineTwo.length() - DISPLAY_COLUMNS);
        }
        
        //scroll 'em if you got 'em
        if(scrollSize > 0) {
          //wait before scrolling.
          delay(DELAY_BEFORE_SCROLL);

          //now scroll left
          scrollLeft(scrollSize);

          //then back right
          scrollRight(scrollSize);
        }
      }
    }
  }
}

void scrollLeft(int numCharacters) {
  for(int i = 0;i < numCharacters; i++) {
    //scroll on back!
    lcd.scrollDisplayLeft(); 

    delay(SCROLL_DELAY);
  }
}

void scrollRight(int numCharacters) {
  for(int i = 0;i < numCharacters; i++) {
    //scroll to the right
    lcd.scrollDisplayRight(); 

    delay(SCROLL_DELAY);
  }
}