new fitness function for genetic algorithm