refactor create_node to accept children as parameters