Resolving bug for weighted values