first index array = 0 n-1