More work on the cost function of DecisionTreeNode class.