function path = return_path(acc_cost_mat)
    n_timestamps_1 = size(acc_cost_mat,1);
    n_timestamps_2 = size(acc_cost_mat,2);
    
    path = [n_timestamps_1 n_timestamps_2];
    
    while (path(end,1) ~= 1) && (path(end,2) ~= 1)
        i = path(end,1);
        j = path(end,2);
        if i == 1
            path = [path; [0 (j - 1)]];
        elseif j == 1
            path = [path; [(i - 1) 0]];  
        else
            arr = [acc_cost_mat(i - 1, j - 1) acc_cost_mat(i - 1, j)...
            acc_cost_mat(i, j - 1)];
            [~, argmin] = min(arr);
            if argmin == 1
                path = [path; [(i - 1) (j - 1)]];
            elseif argmin == 2
                path = [path; [(i - 1) j]];
            else
                path = [path; [i (j - 1)]];
            end
        end
    end
    path = flip(path,1);
    path = path';
end

