private int splitTreeNode(TreeNode currentNode, Set<Node> curCandidates, boolean isTrueChild) {
        Set<Integer> sampleList = null;
        if (isTrueChild) {
            sampleList = currentNode.sampleSetTrue;
        } else {
            sampleList = currentNode.sampleSetFalse;
        }

        Node chosenFeature = chooseFeature(sampleList, curCandidates, storeFile);

        // if all samples are in the same class or no more feature to use, no need to spit
        if ( chosenFeature == null) {
            TreeNode newNode = new TreeNode(null, currentNode);
            // the change made
        	int _noCorrect = update_unclassified(sampleList);
            
            if (_noCorrect < 0){
                newNode.noCorrect = -_noCorrect;
                newNode.classLabel = false;
            } else {
                newNode.noCorrect = _noCorrect;
                newNode.classLabel = true;
            }
            currentNode.insertChild(newNode, isTrueChild);
            if (newNode.noCorrect != sampleList.size())
                unclassified.addAll(sampleList);
            return newNode.noCorrect;
        }

        // get the majority class in the sampleList
        int _noCorrect = getNoCorrect(sampleList);

        if(Math.abs(_noCorrect) == sampleList.size()) {
            TreeNode newNode = new TreeNode(null, currentNode);
 
            if (_noCorrect < 0){
                newNode.noCorrect = -_noCorrect;
                newNode.classLabel = false;
            } else {
                newNode.noCorrect = _noCorrect;
                newNode.classLabel = true;
            }
            currentNode.insertChild(newNode, isTrueChild);
            
            return newNode.noCorrect;
         }
        // other wise keep splitting
        Set<Integer> trueSamples = new HashSet<Integer>();
        Set<Integer> falseSamples = new HashSet<Integer>();

        // split the sample list
        splitSampleOnFeature(chosenFeature.id, sampleList, trueSamples, falseSamples);

        TreeNode newNode = new TreeNode(chosenFeature, currentNode);
        newNode.infoGain = Gain;                    //storing the information gain associated with the other nodes
        usedFeatures.add(chosenFeature);
        insertIntoTreeNodeMap(treeNodeMap, newNode);

        // insert child into current node
        currentNode.insertChild(newNode, isTrueChild);

        // find the new candidate node list
        Set<Node> candidates = newNode.updateCandidateFeatures(curCandidates, featureList);

        _noCorrect = 0;      

        // continue to spit node
        if (!trueSamples.isEmpty()) {
            newNode.sampleSetTrue = trueSamples;            
            _noCorrect += splitTreeNode(newNode, candidates, true);
        }

        if (!falseSamples.isEmpty()) {
            newNode.sampleSetFalse = falseSamples;
            _noCorrect += splitTreeNode(newNode, candidates, false);
        }
        newNode.noCorrect = _noCorrect;
        return _noCorrect;
    }