rewrite the next_gen function crossover part