fixed crossover function