working code, minus the xbee