New function to filter genotypes