Add a length variable to hold the array's length.