     pinMode(buttons[i].pin, INPUT_PULLUP);
   }
   pinMode(start_button.pin, INPUT_PULLUP);
-}
-
-void check_begin(void) {
-  
+  buttonState = digitalRead(start_button.pin);
 }
 
 void loop(void)
 {
   char n, inputs[BUFSIZE+1];
-  bool starting, started = 0;
+  bool debounce1;
+  bool debounce2;
+  bool started;
   if (Serial.available())
   {
     n = Serial.readBytes(inputs, BUFSIZE);

  while ( ble.available() )
  {
    int c = ble.read();

    Serial.print((char)c);
  }

  starting = !digitalRead(start_button.pin);
  
  if(starting && !started) {
    started = starting;

    Serial.print("BEGIN:");
    ble.print("BEGIN:");
    for(int i=0;i<4;i++)


button start_button = {A0, "BEGIN"};
volatile byte pressed, justpressed, justreleased;
bool buttonState;

void error(const __FlashStringHelper*err) {
  Serial.println(err);
