How to calculate the weight of a package