Added weighted gini function