If you have an array [2000], the maximum index is not 2000, but 1999.