Because we use j+1, the second loop doesn't need to reach the last value. This means the for loop only goes until length-1, or 4-1=3.

Might not seem to matter, but this makes the algorithm more efficient and makes sure there are no errors.