The names were numbered 1 to 40,there were 40 balls in a bag to represent the pigeons.
The first ball drawn,say it was number 23,went to number 1 on the name list,2nd number drawn went to number 2 on the list and so on.
The pens with the pigeons in were numbered 1 to 40.