Moved random seed generation to the start of the program