If you've declared an array, then it is best to use it everywhere.
At the moment you're not using it in "setup()".
Also, if you make the array of the correct type, "byte", you can use the size of the array to control your loops, so you should never step off the end.
#define N_ELEMENTS(array) (sizeof(array)/sizeof(array))
(In fact, this method works for arrays of any datatype)