It's pretty obvious if you compare the two, look at the order of the events in actual compared to test. The test code is correct picking, every time you pick an enemy you set the name to the glob var then add 1 to glob var. In actual you are adding 1 to glob var for every enemy, so the total number of enemies, then setting the enemy name for all enemies to the glob var number. Be careful with the order of events and sub-events, you've done it correctly in test code though so I can see you know what you're doing.