remake of seed function.