get weights for writing output