added code to crossover method