Added a function to calculate GINI.