add sanity checks to gini fun