iteratively create nodes