Performancefix: mostRight array of children nodes for better performance in the build function; init d epth function changed to non-recursive to prevent stack overflow