Simplify weight calculation algorithm