function [results] = isoform_estimation_blasso_no_lock_p(A, L, L1, N, N1, NN, read_len, gene,p)

[m,n] = size(A);

% find X_opt
L = [L L1];
L = L - read_len; %The effective exon length
N = [N N1];
A1 = zeros(m*(m-1)/2, n);
l = 1;
for i=1:m         %Calculating the splice matrix: c_{ij}c_{ik}\theta_i
    for j=i+1:m
        A1(l,:) = A(i,:).*A(j,:);
        for k=i+1:j-1
            A1(l,:) = A1(l,:).*(1-A(k,:)); %%There is no other exons between two junction exons
        end
        l = l + 1;
    end
end
A = [A; A1];
i = 1;
while i <= length(L)
    if L(i)<=0
        if N(i)~=0
            %disp(sprintf('warning: L(i)<=0 & N(i)~=0 for gene %s.', gene));
            N(i)=0;
        end
        A(i,:)=[];
        L(i)=[];
        N(i)=[];
        continue;
    end
    i = i + 1;
end

[m,n]=size(A);

A = (NN / 1e6 * (L / 1e3)' * ones(1, n)) .* A; %RPKM,Reads per kilo per million
eps_step = 1;

results = blasso_poisson_no_lock2(N,A,eps_step,p);%A:X,N:Y


