Trying to create a hierarchy of arrays of objects, but recursion function is failing. On closer inspection, it appears to go deeper into the tree, but once it runs out of children it doesn't go back a previous level and keep recursing.Trying to create a hierarchy of arrays of objec