write weights