function [dev2] = SM_fit_dL(params,data,vars)

z = data(:,1);
V = data(:,2);

beta = vars(1);
V0 = vars(2);
C = vars(3);
alpha = vars(4);
L0 = vars(5);
lambda = vars(6);

dL = params;

V_fit = zeros(1,length(z))';

for loop = 1:length(z)
    z_inst = z(loop);
    L = L0 + dL + z_inst;
    V_fit(loop) = selmixpower(beta,C,L,lambda,alpha);
end

V_fit = V_fit + V0;

dev2 = sum((V_fit - V).^2);