function [startingPoint, MaxNumOfStcks] = whereToStart(imBW)
    [r c] = size(imBW);
    %MaxNumOfStcks = 0;
 %   kMax = 0;
    numOfStcks = [];
  
    for k = 1:r    
        A = imBW(k,:);
       [labeledX, numRegions] = bwlabel(A);  
       if A(end) == 1
           numRegions = numRegions-1;
       end
       if A(1) == 1
           numRegions = numRegions-1;
       end
       numOfStcks(end+1) = numRegions;  
      
    end
           [startIdx, MaxNumOfStcks] = findIdxOfClosestValue(numOfStcks,101);
           vect = imBW(startIdx,:);
           if vect(1) == 1
               startCol = 1;
               while vect(startCol) == 1
                  startCol = startCol + 1;
               end
           else
               startCol = 1;
           end

           startingPoint = [startIdx,startCol];
           startingPoint = flip(startingPoint);
end