optimized fitness function