improve fitness function definition