code: func analyticsFor(ss []string, cutoff int) []analytic {
  	m := make(map[string]int)
  	t := 0
  	for _, s := range ss {
  		m[s]++
  		t++
  	}
  
  	l := make([]analytic, 0, len(m))
  	for k, c := range m {
  		l = append(l, analytic{
  			Key:        k,
  			Count:      c,
  			Percentage: 100 * float64(c) / float64(t),
  		})
  	}
  
  	sort.Sort(analyticList(l))
  
  	if cutoff > 0 && len(l) > cutoff {
  		c := 0
  		for _, i := range l[cutoff:] {
  			c += i.Count
  		}
  		l = append(l[:cutoff], analytic{
  			Key:        "Others",
  			Count:      c,
  			Percentage: 100 * float64(c) / float64(t),
  		})
  	}
  
  	return l
  }
docs: // Returns a list of frequency analytics for a given list of strings.