function result = computeBStar(i,j,p,bStar,inFile,len)
temp1=[0,0,0];
Un = [0,0,0];
S = [0,0,0];

for k = i:j
    if k>1 && k<len+1
        i_index = str2double(inFile{5,i});
        j_index = str2double(inFile{1,k});
        
    
			%Check the Pairing possibility
           if (strcmpi(inFile{2,i}, 'T') && strcmpi(inFile{2,k},'A')) || (strcmpi(inFile{2,i},'A') && strcmpi(inFile{2,k},'T'))
                display('AT');
                temp1 = [1,0,0];
            end
           
             if (strcmpi(inFile{2,i}, 'A') && strcmpi(inFile{2,k},'U')) || (strcmpi(inFile{2,i},'U') && strcmpi(inFile{2,k},'A'))
                display('AU');
                temp1 = [1,0,0];
            end
    
            if (strcmpi(inFile{2,i}, 'C') && strcmpi(inFile{2,k},'G')) || (strcmpi(inFile{2,i},'G') && strcmpi(inFile{2,k},'C'))
                display('CG');
                temp1 = [0,1,0];
            end
            if (strcmpi(inFile{2,i}, 'G') && strcmpi(inFile{2,k},'U')) || (strcmpi(inFile{2,i},'U') && strcmpi(inFile{2,k},'G'))
                display('GU');
                temp1 = [0,0,1];
            end
             if (strcmpi(inFile{2,i}, 'G') && strcmpi(inFile{2,k},'T')) || (strcmpi(inFile{2,i},'T') && strcmpi(inFile{2,k},'G'))
                display('GT');
                temp1 = [0,0,1];
            end
            
        %end
        
        S = minksum(p{i+1,k-1},p{k+1,j});
        S = minksum(S, temp1);
        Un = [Un;S];
        
    end
end
result = unique([bStar{i,j};Un],'rows');
result_sum = sum(result,1);
%Check the validity of input for convexhulln
if size(result,1)>2 
    if result_sum(1) ~= 0 && result_sum(2) ~=0 && result_sum(3) ~=0
        temp2 = convhulln(result);
        temp3 = unique((reshape(temp2,size(temp2,1)*3,1)),'rows');
        result = result(temp3,:);
    else
        if result_sum(1) ~= 0 && result_sum(2) ~=0
            result = result(convhull(result(:,1),result(:,2)),:);
        end
        
        if result_sum(2) ~= 0 && result_sum(3) ~=0
            result = result(convhull(result(:,2),result(:,3)),:);
        end  
        
        if result_sum(1) ~= 0 && result_sum(3) ~=0
            result = result(convhull(result(:,1),result(:,3)),:);
        end 
    end
        
end
end

