added weighting and best gradient
added weighting and best gradient
added weighting and best gradient