added testing functionality... havent tested it yet. also parsed out some of the startNode code to several functions (reply and listen)