Flat children algorithm. Probably don't need this anymore since the new algo works differently, but wanted to preserve it "just in case" along with the spec for it and some odds and ends.