Added information gain calculation function.