Program gets in an infinite loop when the it gets to the 4th to last index of the current array. Makes no sense.