separate genotype generation into new function