draft geneity problem code with an array of children
a working version