Thank you so much for taking the time to type all that out! And apologies for not referencing the file name, I was trying to ask in a way that would hopefully be less work to answer but ended up doing the opposite and oversimplifying.
I was just not understanding what I needed to do with randi() and using count1 worked perfectly for what I needed. Thank you!