Code to create family trees