What is happening in the main() function of my Programmable XBee Application?