modify the position of srand() & modify head file arguments