Optimized upper bound and weighting formula in InL2weight.cc