Hi, I found that the alien spawn function has 3 logic errors. (maybe I wrong)

if (aliensPerSpawn > spawnPoints.Length) { aliensPerSpawn = spawnPoints.Length  1; }
「This limits the number of aliens you can spawn by the number of spawn points.」
My Opinion: This limits the number of aliens less 1 than number of spawn points, I think it should be
aliensPerSpawn = spawnPoints.Length;
aliensPerSpawn = (aliensPerSpawn > totalAliens) ? aliensPerSpawn  totalAliens : aliensPerSpawn;
「This means a spawning event will never create more aliens than the maximum amount that you’ve configured.」
My Opinion: If totalAliens is 1, aliensPerSpawn set 11, it will end be 10, still more than totalAliens. Should we first check the smaller number between totalAliens and spawnPoints, then limit aliensPerSpawn less than the smaller?
int smallerNumber = (spawnPoints.Length > totalAliens) ? totalAliens : spawnPoints.Length;
aliensPerSpawn = (smallerNumber > aliensPerSpawn) ? aliensPerSpawn : smallerNumber;
3.int randomNumber = Random.Range(0, spawnPoints.Length  1);
「This line produces a random number as a possible spawn point.」
My Opinion: The Range doesn’t include spawnPoints.Length  1, so the range will be 09, actually we have 010. So if we set aliensPerSpawn 11, the program will probably enter an infinite loop.We should modify as follow:
int randomNumber = Random.Range(0, spawnPoints.Length);
 I don’t understand the usefulness of maxAliensOnScreen, what the difference with totalAliens? Hope you could explain, really appreciate.