add max_weight calculation