fixed a relationship flip bug
genotype write out bug to be fixed