while(1) created an infinite loop. There must be a test in the code to "break" or end the loop.

I later realized that the for() loop was a better choice to prevent an overrun of the end of the array.

You're welcome!