public static boolean networkFinder(Board board, BoardNode node, int numNodes, int prevDir){
         
            //base case - node is a goal and numNodes of that color >= 6
            if(Board.isEndingNode(node, node.getColor()) && numNodes >= 6){
                return true;
            }
            node.changeVisit(true);
            
            BoardNode[] childrenNodeArray; 
            childrenNodeArray = getNodeConnections(board, node);
 
            for(BoardNode child: childrenNodeArray){
                if(child.getVisit() == false){
                    
                    //checks for a connection to another goal in the same starting region as the first goal
                    if(Board.isStartingNode(child, child.getColor()) == true){
                        continue;
                    }

                    if((Board.isEndingNode(child, child.getColor()) == true) && numNodes<5){
                        continue;
                    }
                    //checks for change in direction after 2 in the same direction. 
 
                    if(Evaluator.getDirection(node, child) == prevDir){
                        continue;
                    }
                    boolean y = networkFinder(board, child, numNodes+1, Evaluator.getDirection(node, child));
                    if(y == true){
                        
                        return true;
                    }
                }
            }
            node.changeVisit(false);
            return false;
 
    }