code: func NewFunctionShape(points []FunctionShapePoint) (FunctionShape, error) {
  
  	n := len(points)
  
  	if n == 0 {
  		return nil, fmt.Errorf("at least one point must be specified")
  	}
  
  	for i := 1; i < n; i++ {
  		if points[i-1].Utilization >= points[i].Utilization {
  			return nil, fmt.Errorf("utilization values must be sorted. Utilization[%d]==%d >= Utilization[%d]==%d", i-1, points[i-1].Utilization, i, points[i].Utilization)
  		}
  	}
  
  	for i, point := range points {
  		if point.Utilization < minUtilization {
  			return nil, fmt.Errorf("utilization values must not be less than %d. Utilization[%d]==%d", minUtilization, i, point.Utilization)
  		}
  		if point.Utilization > maxUtilization {
  			return nil, fmt.Errorf("utilization values must not be greater than %d. Utilization[%d]==%d", maxUtilization, i, point.Utilization)
  		}
  		if point.Score < minScore {
  			return nil, fmt.Errorf("score values must not be less than %d. Score[%d]==%d", minScore, i, point.Score)
  		}
  		if point.Score > maxScore {
  			return nil, fmt.Errorf("score valuses not be greater than %d. Score[%d]==%d", maxScore, i, point.Score)
  		}
  	}
  
  	// We make defensive copy so we make no assumption if array passed as argument is not changed afterwards
  	pointsCopy := make(FunctionShape, n)
  	copy(pointsCopy, points)
  	return pointsCopy, nil
  }
docs: // NewFunctionShape creates instance of FunctionShape in a safe way performing all
  // necessary sanity checks.