function [step_size, new_curr_obj, User, BS] = Backtrack_Line_Search(User,Cells,BS,Sim,Beta,t,decreasement,curr_obj)

step_size = 1; %initial step size

%backtrack line search parameters
alpha = 0.3;
beta = 0.5;

while 1>0
    %%%% find the objective with the new R_k and C_l for compression  %%%%%%
    
    %find new amount of backhaul for each BS under the new
    %variables    
    for c = 1:Sim.Num_Cell
        for b = 1:Sim.Num_BS
            BS(c,b).new_data_sharing_bkhaul = 0;
            BS(c,b).new_compression_bkhaul = max(BS(c,b).current_compression_bkhaul + step_size * BS(c,b).curr_bkhaul_newton, BS(c,b).current_min_compression_bkhaul);
            
            for row_idx = 1:size(BS(c,b).data_sharing_users,1)
                cell_idx = BS(c,b).data_sharing_users(row_idx,1);
                usr_idx = BS(c,b).data_sharing_users(row_idx,2);
                
                BS(c,b).new_data_sharing_bkhaul = BS(c,b).new_data_sharing_bkhaul + ...
                    max(User(cell_idx,usr_idx).current_rate + step_size * User(cell_idx,usr_idx).curr_rate_newton, 0); %new rate
            end
        end
    end
    
    %the new objective value under new values of R_k and backhaul C_l for
    %compression
    new_curr_obj = 0;
    
    for c = 1:Sim.Num_Cell
        for ik = 1:length(Cells(c).Scheduled_User)
            k = Cells(c).Scheduled_User(ik);
            User(c,k).new_rate = max( User(c,k).current_rate + step_size * User(c,k).curr_rate_newton, 0);
            
            rx_quantization_noise = 0;
            for cc = 1:Sim.Num_Cell
                for bb = 1:Sim.Num_BS
                    
                    rx_quantization_noise = rx_quantization_noise + Beta(cc,bb,c,k) / (2^BS(cc,bb).new_compression_bkhaul - 1);
                    
                end
            end
            User(c,k).new_sinr = User(c,k).signal_u_k / (User(c,k).intf_plus_noise_v_k + rx_quantization_noise);
            
            new_curr_obj = new_curr_obj - User(c,k).wgt_wsr * User(c,k).new_rate - log( log2(1 + User(c,k).new_sinr) - User(c,k).new_rate ) / t;
        end
    end
    
    for c = 1:Sim.Num_Cell
        for b = 1:Sim.Num_BS
            
            temp = BS(c,b).total_bkhaul_budget - BS(c,b).new_compression_bkhaul - BS(c,b).new_data_sharing_bkhaul;
            new_curr_obj = new_curr_obj - log(temp) / t;
        end
    end
    
    
%     if (new_curr_obj - curr_obj) > 0
%         fprintf('$$$$$ Obj is not decreasing  $$$$$$\n');
%         return;
%     end
    
    %stop if enough decreasement
    if (new_curr_obj - curr_obj) < alpha * step_size * decreasement
        break;
    else
        step_size = beta * step_size;
    end
    
    if step_size < 1e-10
        fprintf('$$$$ No Step Size Found $$$$ \n');
    end
    
    

end