generate weights