begun interrupt code, refactoring xbee code