came to my senses and used a for loop