make each node a dictionary with object name: children dictionaries