put default seed generation in a function