In the below code i need you to review and update the logic, whether the implemented logic for the fitness value calculation for the phase margin is properly as per logic and procedure.

i need the fitness value of the metric 'phaseMargin' to be dynamic based in the range of phase margin values
if the phase margin normalized_value is between 60 and 75, no penalty required
if the phase margin normalized_value is between 45 and 59, we need to apply penalty with weight '2.0', ( i am having doubt in the implementation of '2.0 * (normalized_value - 70)' whether it is correct or wrong to this computation)
if the phase margin normalized_value is between 0 and 44, we need to apply penalty with weight '3.0', ( i am having doubt in the implementation of '3.0 * (normalized_value - 70)' whether it is correct or wrong to this computation)
if the phase margin normalized_value is between 76 and 89, we need to apply penalty with weight '3.0', ( i am having doubt in the implementation of '3.0 * (normalized_value - 70)' whether it is correct or wrong to this computation)
if the phase margin normalized_value is above 90, we need to apply penalty with weight '4.0', ( i am having doubt in the implementation of '4.0 * (95 - normalized_value)' whether it is correct or wrong to this computation)
if the phase margin normalized_value is negative, we need to apply penalty with weight '4.0', ( i am having doubt in the implementation of '4.0 * (normalized_value - 70)' whether it is correct or wrong to this computation)


    for metric, weight in weights.items():
        value = objective_metrics.get(metric, 0.0)
        
        # Normalize the value based on its scaling factor
        normalized_value = value / scaling_factors[metric]

        if metric == 'Area' or metric == 'PowerDissipation':
            # Apply heavy penalties for Area and PowerDissipation
            fitness_values[metric] = weight * normalized_value
        else:
            # For other metrics, apply normal weightage
            if metric == 'SlewRate' and normalized_value < 10:
                # Penalize SlewRate if it's less than 20
                fitness_values[metric] = weight * (normalized_value - 10)
            elif metric == 'Gain' and normalized_value < 70:
                # Penalize Gain if it's less than 40
                fitness_values[metric] = weight * (normalized_value - 70)
            elif metric == 'Bandwidth3dB' and normalized_value < 30:
                # Penalize Bandwidth3dB if it's less than 30e3
                fitness_values[metric] = weight * (normalized_value - 30)
            elif metric == 'GainBWProd' and normalized_value < 10:
                # Penalize GainBWProd if it's less than 30e6
                fitness_values[metric] = weight * (normalized_value - 10)
            elif metric == 'UnityGainFreq' and normalized_value < 10:
                # Penalize UnityGainFreq if it's less than 30e6
                fitness_values[metric] = weight * (normalized_value - 10)
            elif metric == 'PhaseMargin':
                # Adjust 'PhaseMargin' penalties based on specified conditions
                if 60 <= normalized_value <= 75:
                    # No penalty if 'PhaseMargin' is between 60 and 75
                    fitness_values[metric] = 0.0
                elif 45 <= normalized_value <= 59:
                    # Penalize if 'PhaseMargin' is between 45 and 59
                    fitness_values[metric] = 2.0 * (normalized_value - 70)
                elif 0 <= normalized_value <= 44:
                    # Penalize if 'PhaseMargin' is between 0 and 44
                    fitness_values[metric] = 3.0 * (normalized_value - 70)
                elif 76 <= normalized_value <= 89:
                    # Penalize if 'PhaseMargin' is between 76 and 89
                    fitness_values[metric] = 3.0 * (normalized_value - 70)                    
                elif normalized_value > 90:
                    # Penalize if 'PhaseMargin' is above 90
                    fitness_values[metric] = 4.0 * (95 - normalized_value)
                elif normalized_value < 0:
                    # Penalize if 'PhaseMargin' is negative
                    fitness_values[metric] = 4.0 * (normalized_value - 70)