function CellOfTops = sortTops(ActCell,CellOfTops)
    for i = 1:length(CellOfTops{ActCell})
        if i >=2
            actTops = CellOfTops{1,ActCell}{1,i};
            xTops = actTops(:,2);
            yTops = actTops(:,1);
            PreviousTops = CellOfTops{1,ActCell}{1,i-1};
            PreviousTops = PreviousTops(:,2);
            lastPreviousX = PreviousTops(end);
            diffFirstX = lastPreviousX - xTops(1);
            xTops = xTops + diffFirstX;
            CellOfTops{1,ActCell}{1,i} = [yTops xTops];
        end
    end
end