Collapsing nodes work for 1 layer

Collapsing works for this:

.
Code will clean up to

.
Now looking at nested nodes using recursion.