code: func GetNextLevel(last Epoch, now uint64) uint8 {
  	// First XOR the last epoch base time with the current clock.
  	// This will set all the common most significant bits to zero.
  	mix := (last.Base() ^ now)
  
  	// Then, make sure we stop the below loop before one level below the current, by setting
  	// that level's bit to 1.
  	// If the next level is lower than the current one, it must be exactly level-1 and not lower.
  	mix |= (1 << (last.Level - 1))
  
  	// if the last update was more than 2^highestLevel seconds ago, choose the highest level
  	if mix > (maxuint64 >> (64 - HighestLevel - 1)) {
  		return HighestLevel
  	}
  
  	// set up a mask to scan for nonzero bits, starting at the highest level
  	mask := uint64(1 << (HighestLevel))
  
  	for i := uint8(HighestLevel); i > LowestLevel; i-- {
  		if mix&mask != 0 { // if we find a nonzero bit, this is the level the next update should be at.
  			return i
  		}
  		mask = mask >> 1 // move our bit one position to the right
  	}
  	return 0
  }
docs: // GetNextLevel returns the frequency level a next update should be placed at, provided where
  // the last update was and what time it is now.
  // This is the first nonzero bit of the XOR of 'last' and 'now', counting from the highest significant bit
  // but limited to not return a level that is smaller than the last-1