%% Reduction factor for spousal benefit
function f = spousal_factor(age, fra)
    if age < fra
        months_early = round((fra - age) * 12);
        if months_early <= 36
            f = (25/36)/100 * months_early;
        else
            f = (25/36)/100 * 36 + (5/12)/100 * (months_early - 36);
        end
    else
        f = 0; % No delayed credits for spousal benefits (cap at fra)
    end
end