Yeah, I'm not sure. I left the existing code as it was and just added the pre-processing step of sorting the verticals by index_in_children_list. I'm not inclined to do too much to this code as it will be going away with split mongo.