You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: update_order.m
    path of file: ./repos/MIN1PIPE/utilities/CNMF
    
    the code of the file until where you have to start completion: function [O,lo] = update_order(A)

    K = size(A,2);
    F = (A'*A>0);       % find overlapping components
    F(1:K+1:K^2) = 0;   % remove diagonal elements

    
function [O,lo] = update_order(A)

    K = size(A,2);
    F = (A'*A>0);       % find overlapping components
    F(1:K+1:K^2) = 0;   % remove diagonal elements
    rem_ind = 1:K;      % remaining indices

    dp = 0;
    while ~isempty(rem_ind);
        dp = dp+1;
        L = sort(app_vertex_cover(F(rem_ind,rem_ind)),'ascend