sketch combination algorithm