build the geneology