Added write command to print selected nodes to the console