@jSylvestre are there checks to make sure the number of terms is equal to the scaleUpperLimit that's passed?  IMHO you shouldn't even bother taking the scaleUpperLimit as a param and instead just calculate it based on terms.Count()