finished writing code for seeding, not tested.