function [ Inds, low_th, high_th, normalized] = Find_outliers(x,steps)

    Q=quantile(x,[0.25 0.75]);
    out=[Q(1)-(1.5*diff(Q)) Q(2)+(1.5*diff(Q))];
    l_inds= x<out(1); low_th=out(1); h_inds= x>out(2); high_th=out(2);
    lower=x(l_inds); higher=x(h_inds);
    for i=1:steps-1
        %for higher
        Q=quantile(higher,[0.25 0.75]);
        out=Q(2)+(1.5*diff(Q)); high_th=out;
        h_inds= x>out; higher=x(h_inds);
        %for lower
        Q=quantile(lower,[0.25 0.75]);
        out=Q(1)-(1.5*diff(Q)); low_th=out;
        l_inds= x<out; lower=x(l_inds);
    end
    Inds=find(h_inds | l_inds);
    n_x=(x-low_th)/(high_th-low_th);
    normalized=n_x-mean(n_x);
end

