code: func optimalChains(chains [][]*x509.Certificate) [][]*x509.Certificate {
  	// Find shortest chains
  	chains = ubiquity.Filter(chains, ubiquity.CompareChainLength)
  	// Find the chains with longest expiry.
  	chains = ubiquity.Filter(chains, ubiquity.CompareChainExpiry)
  	// Find the chains with more advanced crypto suite
  	chains = ubiquity.Filter(chains, ubiquity.CompareChainCryptoSuite)
  
  	return chains
  }
docs: // Optimal chains are the shortest chains, with newest intermediates and most advanced crypto suite being the tie breaker.