updated fitness function