Interaction in the array with for loop