recursive generation almost working, need to fix placement of child end