moved srand seeding to main