diff --git a/AndroidAccessory/AndroidAccessory.cpp b/AndroidAccessory/AndroidAccessory.cpp
index d063910..59a6739 100644
--- a/AndroidAccessory/AndroidAccessory.cpp
+++ b/AndroidAccessory/AndroidAccessory.cpp
@@ -19,20 +19,20 @@
 #include <Usb.h>
 #include <AndroidAccessory.h>
 
-#define USB_ACCESSORY_VENDOR_ID 0x18D1
-#define USB_ACCESSORY_PRODUCT_ID 0x2D00
+#define USB_ACCESSORY_VENDOR_ID         0x18D1
+#define USB_ACCESSORY_PRODUCT_ID        0x2D00
 
-#define USB_ACCESSORY_ADB_PRODUCT_ID 0x2D01
-#define ACCESSORY_STRING_MANUFACTURER 0
-#define ACCESSORY_STRING_MODEL 1
-#define ACCESSORY_STRING_DESCRIPTION 2
-#define ACCESSORY_STRING_VERSION 3
-#define ACCESSORY_STRING_URI 4
-#define ACCESSORY_STRING_SERIAL 5
+#define USB_ACCESSORY_ADB_PRODUCT_ID    0x2D01
+#define ACCESSORY_STRING_MANUFACTURER   0
+#define ACCESSORY_STRING_MODEL          1
+#define ACCESSORY_STRING_DESCRIPTION    2
+#define ACCESSORY_STRING_VERSION        3
+#define ACCESSORY_STRING_URI            4
+#define ACCESSORY_STRING_SERIAL         5
 
-#define ACCESSORY_GET_PROTOCOL 51
-#define ACCESSORY_SEND_STRING 52
-#define ACCESSORY_START 53
+#define ACCESSORY_GET_PROTOCOL          51
+#define ACCESSORY_SEND_STRING           52
+#define ACCESSORY_START                 53
 
 
 AndroidAccessory::AndroidAccessory(const char *manufacturer,
@@ -60,15 +60,22 @@
 int AndroidAccessory::getProtocol(byte addr)
 {
     uint16_t protocol = -1;
-    usb.ctrlReq(addr, 0, USB_SETUP_DEVICE_TO_HOST | USB_SETUP_TYPE_VENDOR | USB_SETUP_RECIPIENT_DEVICE,
+    usb.ctrlReq(addr, 0,
+                USB_SETUP_DEVICE_TO_HOST |
+                USB_SETUP_TYPE_VENDOR |
+                USB_SETUP_RECIPIENT_DEVICE,
                 ACCESSORY_GET_PROTOCOL, 0, 0, 0, 2, (char *)&protocol);
     return protocol;
 }
 
 void AndroidAccessory::sendString(byte addr, int index, const char *str)
 {
-    usb.ctrlReq(addr, 0, USB_SETUP_HOST_TO_DEVICE | USB_SETUP_TYPE_VENDOR | USB_SETUP_RECIPIENT_DEVICE,
-                ACCESSORY_SEND_STRING, 0, 0, index, strlen(str) + 1, (char *)str);
+    usb.ctrlReq(addr, 0,
+                USB_SETUP_HOST_TO_DEVICE |
+                USB_SETUP_TYPE_VENDOR |
+                USB_SETUP_RECIPIENT_DEVICE,
+                ACCESSORY_SEND_STRING, 0, 0, index,
+                strlen(str) + 1, (char *)str);
 }
 
 
@@ -90,11 +97,21 @@
     sendString(addr, ACCESSORY_STRING_URI, uri);
     sendString(addr, ACCESSORY_STRING_SERIAL, serial);
 
-    usb.ctrlReq(addr, 0, USB_SETUP_HOST_TO_DEVICE | USB_SETUP_TYPE_VENDOR | USB_SETUP_RECIPIENT_DEVICE,
+    usb.ctrlReq(addr, 0,
+                USB_SETUP_HOST_TO_DEVICE |
+                USB_SETUP_TYPE_VENDOR |
+                USB_SETUP_RECIPIENT_DEVICE,
                 ACCESSORY_START, 0, 0, 0, 0, NULL);
+
+    while (usb.getUsbTaskState() != USB_DETACHED_SUBSTATE_WAIT_FOR_DEVICE) {
+        max.Task();
+        usb.Task();
+    }
+
     return true;
 }
 
+// Finds the first bulk IN and bulk OUT endpoints
 bool AndroidAccessory::findEndpoints(byte addr, EP_RECORD *inEp, EP_RECORD *outEp)
 {
     int len;
@@ -189,9 +206,7 @@
     in = inEp.epAddr;
     out = outEp.epAddr;
 
-    Serial.print("inEp: ");
     Serial.println(inEp.epAddr, HEX);
-    Serial.print("outEp: ");
     Serial.println(outEp.epAddr, HEX);
 
     epRecord[0] = *(usb.getDevTableEntry(0,0));
@@ -220,12 +235,12 @@
         usb.getUsbTaskState() >= USB_STATE_CONFIGURING &&
         usb.getUsbTaskState() != USB_STATE_RUNNING) {
         Serial.print("\nDevice addressed... ");
-        Serial.print("Requesting device descriptor.");
+        Serial.print("Requesting device descriptor.\n");
 
         err = usb.getDevDescr(1, 0, 0x12, (char *) devDesc);
         if (err) {
-            Serial.print("\nDevice descriptor cannot be retrieved. Program Halted\n");
-            while(1);
+            Serial.print("\nDevice descriptor cannot be retrieved. Trying again\n");
+            return false;
         }
 
         if (isAccessoryDevice(devDesc)) {
@@ -237,6 +252,8 @@
             switchDevice(1);
         }
     } else if (usb.getUsbTaskState() == USB_DETACHED_SUBSTATE_WAIT_FOR_DEVICE) {
+        if (connected)
+            Serial.println("disconnect\n");
         connected = false;
     }
 
diff --git a/AndroidAccessory/AndroidAccessory.h b/AndroidAccessory/AndroidAccessory.h
index 1d4542d..6610307 100644
--- a/AndroidAccessory/AndroidAccessory.h
+++ b/AndroidAccessory/AndroidAccessory.h
@@ -65,5 +65,4 @@
     int write(void *buff, int len);
 };
 
-
 #endif /* __AndroidAccessory_h__ */
diff --git a/USB_Host_Shield/main.cpp b/USB_Host_Shield/main.cpp
deleted file mode 100644
index 0a50f68..0000000
--- a/USB_Host_Shield/main.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright 2009-2011 Oleg Mazurov, Circuits At Home, http://www.circuitsathome.com
- * MAX3421E USB host controller support
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the authors nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-/* Mouse communication via control endpoint */
-#include <spi.h>
-#include <max3421e.h>
-#include <usb.h>
- 
-#define DEVADDR 1
-#define CONFVALUE 1
- 
-void setup();
-void loop();
- 
-MAX3421E Max;
-USB Usb;
- 
-void setup()
-{
-    Serial.begin( 115200 );
-    Serial.println("Start");
-    Max.powerOn();
-    delay( 200 );
-}
- 
-void loop()
-{
- byte rcode;
-    Max.Task();
-    Usb.Task();
-    if( Usb.getUsbTaskState() == USB_STATE_CONFIGURING ) {
-        mouse0_init();
-    }//if( Usb.getUsbTaskState() == USB_STATE_CONFIGURING...
-    if( Usb.getUsbTaskState() == USB_STATE_RUNNING ) {  //poll the keyboard
-        rcode = mouse0_poll();
-        if( rcode ) {
-          Serial.print("Mouse Poll Error: ");
-          Serial.println( rcode, HEX );
-        }//if( rcode...
-    }//if( Usb.getUsbTaskState() == USB_STATE_RUNNING...
-}
-/* Initialize mouse */
-void mouse0_init( void )
-{
- byte rcode = 0;  //return code
-  /**/
-  Usb.setDevTableEntry( 1, Usb.getDevTableEntry( 0,0 ) );              //copy device 0 endpoint information to device 1
-  /* Configure device */
-  rcode = Usb.setConf( DEVADDR, 0, CONFVALUE );
-  if( rcode ) {
-    Serial.print("Error configuring mouse. Return code : ");
-    Serial.println( rcode, HEX );
-    while(1);  //stop
-  }//if( rcode...
-  Usb.setUsbTaskState( USB_STATE_RUNNING );
-  return;
-}
-/* Poll mouse using Get Report and print result */
-byte mouse0_poll( void )
-{
-  byte rcode,i;
-  char buf[ 4 ] = { 0 };      //mouse buffer
-  static char old_buf[ 4 ] = { 0 };  //last poll
-    /* poll mouse */
-    rcode = Usb.getReport( DEVADDR, 0, 4, 0, 1, 0, buf );
-    if( rcode ) {  //error
-      return( rcode );
-    }
-    for( i = 0; i < 4; i++) {  //check for new information
-      if( buf[ i ] != old_buf[ i ] ) { //new info in buffer
-        break;
-      }
-    }
-    if( i == 4 ) {
-      return( 0 );  //all bytes are the same
-    }
-    /* print buffer */
-    if( buf[ 0 ] & 0x01 ) {
-      Serial.print("Button1 pressed ");
-    }
-    if( buf[ 0 ] & 0x02 ) {
-      Serial.print("Button2 pressed ");
-    }
-    if( buf[ 0 ] & 0x04 ) {
-      Serial.print("Button3 pressed ");
-    }
-    Serial.println("");
-    Serial.print("X-axis: ");
-    Serial.println( buf[ 1 ], DEC);
-    Serial.print("Y-axis: ");
-    Serial.println( buf[ 2 ], DEC);
-    Serial.print("Wheel: ");
-    Serial.println( buf[ 3 ], DEC);
-    for( i = 0; i < 4; i++ ) {
-      old_buf[ i ] = buf[ i ];  //copy buffer
-    }
-    Serial.println("");
-    return( rcode );
-}
