oh, that was a bit confusing a few minutes i was thinking about ur words. gladly i finaly got it, my thoughts about random were wrong, random is in the 4th line not 3th as i said. loopindex just a place in array (0,1,2...), but my "for" starts from 1, so when FOR=1 i have a place in array under 0, when for=2 array has 1, thats why i have to subtract 1, therefore loopindex-1.
probably my explanation of my understanding is a bit wrong, but for me my question is answered, thank you so much=)