I followed your suggestion and corrected my contrains...This now reflects the actual sizes of all the arrays, so no more array bounds violations I hope.
I really don't see how constraining what should be constants is going to help anything. Personally, I think trying to just screams "clueless". Just assign the variable the correct value in the first place.
It's not like you are constraining things in loop, where there might be value added doing so.
if(curMillis - windowStartTime>windowSize) windowStartTime += windowSize;
Adding time variables is a bad idea.
Some comments in the code, on the other hand, would be a good idea, as would using Tools + Auto Format to correct the inconsistent indenting.
A lot of the stuff in loop() should be put in functions.