you should use `array1.each_index`