Move srand() to main function to only be called once