There’s a lot for you to learn, but hopefully you can make sense of the attached. It gets the full function done around 30 lines as opposed to 300. I’ve tried to keep the logic simple, so have flattened the trees into lists, and only used lists/tuples.
if_else.gh (99.0 KB)