add weights[optional]