public void recursiveTraverse(int[][] mask, int[][] c, int Astart, ArrayList[] AinT, ArrayList[] BinT){
        if(!AinT[0].contains(Astart)) // shouldn't need this conditional...
            AinT[0].add(new Integer(Astart));
        for(int j = 0; j < mask[0].length; j++){
            if(c[Astart][j] == 0 && mask[Astart][j] == 2){
                c[Astart][j] = 1;
                if(!BinT[0].contains(j))
                    BinT[0].add(new Integer(j));
                for(int i = 0; i < mask.length; i++){
                    if(c[i][j] == 0 && mask[i][j] == 1){
                        c[i][j] = 1;
                        recursiveTraverse(mask, c, i, AinT, BinT);
                    }
                }
            }
        }
        return;
    }