function linkList = treeLinkFeatures(data)

linkList = aglomCluster(data);

linkList(:,4) = 0;
listSize = size(data,1);
currentRow = [size(linkList,1)];


while (linkList(currentRow(1),1) > listSize && linkList(currentRow(1),2) > listSize)
    classList = traceLinkageToBinary(linkList, currentRow);
    linkList(:,4) = rfFeatureSelection(data(classList>0,:), classList(classList>0));
    currentRow = [currentRow(2:end); currentRow(1),1; currentRow(1),2];
end

end