add name of nodes on the same line of function output