Code atapted from tutorial builds and runs, now to test with xbee