AWOL:
// Used to check pattern after all 7 array slots
The array is declared with 6 elements, zero to five.
Well this quickly solved one problem. I'm too rusty on arrays and was mistaken in thinking that defining it as '6' meant it stopped at slot 6 (0-6) and was actually 7 slots. Big thanks.
The issue of the code not resetting properly still exists though.