processing the input stream in addNode()