It'll work because there's a while loop running that checks if the node has any child nodes left. As far as I've tested it, it works. I'll soon provide test coverage for the same.