improved RandomWeightedInt