generate_nodes works