code: func relayAddressesOrder(input []string) []string {
  	buckets := make(map[int][]string)
  
  	for _, relay := range input {
  		latency, err := osutil.GetLatencyForURL(relay)
  		if err != nil {
  			latency = time.Hour
  		}
  
  		id := int(latency/time.Millisecond) / 50
  
  		buckets[id] = append(buckets[id], relay)
  	}
  
  	var ids []int
  	for id, bucket := range buckets {
  		shuffle(bucket)
  		ids = append(ids, id)
  	}
  
  	sort.Ints(ids)
  
  	addresses := make([]string, len(input))
  
  	for _, id := range ids {
  		addresses = append(addresses, buckets[id]...)
  	}
  
  	return addresses
  }
docs: // relayAddressesOrder checks the latency to each relay, rounds latency down to
  // the closest 50ms, and puts them in buckets of 50ms latency ranges. Then
  // shuffles each bucket, and returns all addresses starting with the ones from
  // the lowest latency bucket, ending with the highest latency buceket.