rename children to children*, add a flattening children